(no subject)

Hello,

I am a new user in obspy. I work with OpenSuse 12.1(VM) on Windows7

I cannot read filename.sac
Then I decided to work with the examples and that’s what I got

st = read(“http://examples.obspy.org/ev0_6.a01.gse2”)
Traceback (most recent call last):
File “”, line 1, in
File “/usr/local/lib/python2.7/site-packages/obspy-0.8.3_49_g511c8_dirty-py2.7-linux-i686.egg/obspy/core/stream.py”, line 242, in read
st.extend(_read(fh.name, format, headonly, **kwargs).traces)
File “/usr/local/lib/python2.7/site-packages/obspy-0.8.3_49_g511c8_dirty-py2.7-linux-i686.egg/obspy/core/util/decorator.py”, line 152, in wrapped_func
result = func(filename, *args, **kwargs)
File “/usr/local/lib/python2.7/site-packages/obspy-0.8.3_49_g511c8_dirty-py2.7-linux-i686.egg/obspy/core/stream.py”, line 289, in _read
headonly=headonly, **kwargs)
File “/usr/local/lib/python2.7/site-packages/obspy-0.8.3_49_g511c8_dirty-py2.7-linux-i686.egg/obspy/core/util/base.py”, line 390, in _readFromPlugin
‘isFormat’)
File “/usr/local/lib/python2.7/site-packages/distribute-0.6.36-py2.7.egg/pkg_resources.py”, line 343, in load_entry_point
return get_distribution(dist).load_entry_point(group, name)
File “/usr/local/lib/python2.7/site-packages/distribute-0.6.36-py2.7.egg/pkg_resources.py”, line 2309, in load_entry_point
return ep.load()
File “/usr/local/lib/python2.7/site-packages/distribute-0.6.36-py2.7.egg/pkg_resources.py”, line 2015, in load
entry = import(self.module_name, globals(),globals(), [‘name’])
File “/usr/local/lib/python2.7/site-packages/obspy.gse2-0.7.0-py2.7-linux-i686.egg/obspy/gse2/core.py”, line 7, in
from obspy.gse2 import libgse2, libgse1
File “/usr/local/lib/python2.7/site-packages/obspy.gse2-0.7.0-py2.7-linux-i686.egg/obspy/gse2/libgse2.py”, line 29, in
from obspy.core.util import c_file_p, formatScientific
ImportError: cannot import name formatScientific

I tried to take another example from http://docs.obspy.org/gallery.html

but get such result:

from obspy.core import read
st = read(‘http://examples.obspy.org/RJOB_061005_072159.ehz.new’)
Traceback (most recent call last):
File “”, line 1, in
File “/usr/local/lib/python2.7/site-packages/obspy-0.8.3_49_g511c8_dirty-py2.7-linux-i686.egg/obspy/core/stream.py”, line 242, in read
st.extend(_read(fh.name, format, headonly, **kwargs).traces)
File “/usr/local/lib/python2.7/site-packages/obspy-0.8.3_49_g511c8_dirty-py2.7-linux-i686.egg/obspy/core/util/decorator.py”, line 152, in wrapped_func
result = func(filename, *args, **kwargs)
File “/usr/local/lib/python2.7/site-packages/obspy-0.8.3_49_g511c8_dirty-py2.7-linux-i686.egg/obspy/core/stream.py”, line 289, in _read
headonly=headonly, **kwargs)
File “/usr/local/lib/python2.7/site-packages/obspy-0.8.3_49_g511c8_dirty-py2.7-linux-i686.egg/obspy/core/util/base.py”, line 390, in _readFromPlugin
‘isFormat’)
File “/usr/local/lib/python2.7/site-packages/distribute-0.6.36-py2.7.egg/pkg_resources.py”, line 343, in load_entry_point
return get_distribution(dist).load_entry_point(group, name)
File “/usr/local/lib/python2.7/site-packages/distribute-0.6.36-py2.7.egg/pkg_resources.py”, line 2309, in load_entry_point
return ep.load()
File “/usr/local/lib/python2.7/site-packages/distribute-0.6.36-py2.7.egg/pkg_resources.py”, line 2015, in load
entry = import(self.module_name, globals(),globals(), [‘name’])
File “/usr/local/lib/python2.7/site-packages/obspy.gse2-0.7.0-py2.7-linux-i686.egg/obspy/gse2/core.py”, line 7, in
from obspy.gse2 import libgse2, libgse1
File “/usr/local/lib/python2.7/site-packages/obspy.gse2-0.7.0-py2.7-linux-i686.egg/obspy/gse2/libgse2.py”, line 29, in
from obspy.core.util import c_file_p, formatScientific
ImportError: cannot import name formatScientific

Has anyone explained to me the reason for my bad luck. Distribute and package I just today updated, but the result is still the same.

Regards,
Rugija

Hi Rugia,

you have two versions of ObsPy installed and now it mixes them which of course does not work.

The recent one is:

usr/local/lib/python2.7/site-packages/obspy-0.8.3

And you also have the older ones installed:

/usr/local/lib/python2.7/site-packages/obspy.*-0.7.0

To fix this issue remove all folders that have obspy in their name and not the version number 0.8.3 in /usr/local/lib/python2.7/site-packages. Also open all *.pth files in the same folder and do the same to all lines in the files.

Alternatively you also just remove all references to obspy in that directory and the *.pth files and reinstall the latest version.

Cheers!

Lion

Hi Rugija,

you have a problem with your ObsPy installation. Note the various
different ObsPy version numbers in the Error Traceback.
It is a mix of old ObsPy packages (with one package per submodule,
version 0.7.x) and the recent ObsPy 0.8.3.

You need to remove all ObsPy stuff < 0.8.3 so that no cross imports
between different version can happen. (I think you should find some
information on manual removing of installed modules in the list archive).

This is only a problem with the version switch from 0.7.x to 0.8.x and
will not be necessary with version updates in the future.

best,
Tobias

Dear Lion and Tobias,

Thank you for helping.
I did just as you advised, ( remove all ObsPy stuff < 0.8.3) and the problem was resolved.

Thank you
Rugija