I am trying to install obspy-27 on mac OS 10.9.4 and it's not going
I tried to do the install via Fink package manager but it seems to be
a bunch of classes/packages needed (e.g., imaging).
So I cloned the obspy Git repo to my machine.
I'm trying to confirm the install by running:
obspy/core/tests/test_utcdatetime.py , etc.
It fails with:
line 18, in <module>
from lxml import etree
ImportError: No module named lxml
Indeed, there is no file lxml.py in the distro, and if I comment this
line out, it
dlopen(/sw/lib/python2.7/site-packages/obspy/core/util/../../lib/libmseed_Darwin_64bit_py27.so, 6): image not found
From Fink, I have mseed/lib/libmseed.so
It feels like whack-a-mole getting this installed correctly under
Mavericks. There is very little Mac OS X
documentation - it seems to point to 2 other package managers (HomeBrew
and MacPorts), both of which
appear to contain the same source code as Fink.
There just seem to be so many missing pieces it makes me wonder if I am
missing some more fundamental install step that would take care of all
the dependencies (?)
I see an (old) mac installer under obspy/osx_app/ but this looks like
it's going to be equally unpleasant (also, I already
have python, numpy, scipy, matplotlib successfully installed, so it's
just obspy that's problematic!)
If anyone has tips on getting this installed correctly under 10.9 they
would be greatly appreciated.
the Homebrew and MacPorts installation procedures should work just fine. I do not know anything about Fink; does it use the same packages as MacPorts? If yes, are they fully compatible? If no; who builts ObsPy Fink packages? They might be extremely outdated.
I would strongly recommend to just install via Anaconda, as detailed here:
This usually solves all issues. If you don’t want to do that for some reasons I’ll write down some more hints.
Homebrew and MacPorts are know to work as described on the wiki. If they don’t there is usually something wrong with the Python installation. A common problem is that people end up with two versions of Python modules on the Python search path.
If you want to install it into your existing installation, you should follow the instructions here:
You just need to make sure the required dependencies are available. For example lxml is a dependency and your installation complains about it missing. The second error message also points towards some installation problems. Also you should not need to checkout from git; actually if you don’t have a good reason to use the latest dev version of ObsPy please stick to the releases.
Can you make sure that your Python search Path is free of anything related to ObsPy. Then make sure you have a C and a Fortran compiler installed. Fortran compilers are a bit tricky on OSX - I have good experience with the gfortran (now in the gcc package) from Homebrew.
Then just type
$ pip install obspy
Should install obspy including all dependencies. Note that numpy must be installed beforehand.
thanks for your response.
I don’t think the problem is with my obspy install.
I am only executing obspy modules from within the anaconda distribution,
I’m only using the git repo as a reference and to run the test .py codes.
I have not changed anything inside the anaconda distribution.
I think the problem is the build within anaconda is missing some pieces.
/usr/local/anaconda/lib/python2.7/site-packages/obspy/core/ - does not contain compatibility.py
I can see this file in the git tree so I’ll just copy it over to the anaconda tree.
Now when I run:
python …/test_stream.py - the error complaining that it couldn’t find compatibility.py goes away,
but a new one emerges:
Traceback (most recent call last):
File “test_stream.py”, line 11, in
from obspy.core.util.base import (NamedTemporaryFile, getMatplotlibVersion,
ImportError: cannot import name getSciPyVersion
So, I just checked and getSciPyVersion() is in obspy/core/util/base.py in the git tree,
but it is not in /usr/local/anaconda/lib/python2.7/site-packages/obspy/core/util/base.py
So I guess what I’m looking at are two different versions of obspy
and probably the one in anaconda is a little older and can’t be used to run some of the newer test.py files
in the git tree.
Yes, this seems to be the issue (trying to use the older obspy to run the newer tests).
Sorry for that!
I’ve also noticed that other parts of obspy have been deprecated, e.g., the example 1 from your
2010 SRL paper - I guess that now the arclink server requires a user name and not a port # (?)