OBSPY and PyInstaller


I'm struggling to get obspy working with PyInstaller. If anyone has had success with this please send tips/links/etc.

I have tried with PyInstaller and py2exe, with similar results. With PyInstaller, and obspy installed from the sourceforge executable, I get the following runtime error:

ImportError: Could not load shared library for obspy.segy.

  [Error 126] The specified module could not be found

This error is generated by osbpy.segy.util(). The fact that the exectuable knows about this function is a good start, and when I use the PyInstaller Archive Viewer I can see that obspy.segy.core, amongst other obspy modules, is included in the .pyz archive. The problem seems to be that the obs.*.pyd files are not included in the "dist" directory.

Any help is much appreciated,


I've been able to bundle obspy into a py2exe application, but that was=20
at times when obspy.* packages were installed separately (I used=20
easy_install obspy.core ...etc...). The basic was to parse the eggs and=20
add the content to the library [+] adding an egg.pth into the py2exe app=20
folder. I've put an example on my website=20
Today, as obspy can be installed as a single package, I'm unsure if it's=20
still working... Anyway, this might help you...

Best regards from Brussels,


Hello again,

I copied the "obspy" directory from C:\Python27\Lib\site-packages\ to my "dist" directory, and this solved the import problem...to an extent. The runtime now finds functions such as readSEGY, which I have imported as:

from obspy.segy.core import readSEGY

however functions such as detrend, which are called as member functions of a Stream variable, cause the following error:

   File "C:\Python27\Lib\site-packages\obspy\core\stream.py", line 2105, in detrend
   File "C:\Python27\Lib\site-packages\obspy\core\trace.py", line 1619, in detrend
     func = _getFunctionFromEntryPoint('detrend', type)
   File "C:\Python27\Lib\site-packages\obspy\core\util\base.py", line 343, in _getFunctionFromEntryPoint
     raise ImportError(msg % (group.capitalize()))
ImportError: Your current ObsPy installation does not support any Detrend functions. Please make sure SciPy is installed properly.

I suspect that this error is similar to my original one, i.e. the required obspy modules have not been converted to .pyd files in the correct way.