obspy installation

Hi,

I am a newbie of python and ObsPy. I am trying to install ObsPy on my opensuSE 11.3 machine, but encounter a problem.

When I run as root:

/usr/lib/python/site-package/easy_install –N obspy.core

then screen displays as :

error: can’t create or remove files in install directory

the following error occurred while trying to add or remove files in the installation directory:

[Errno 2] No such file or directory: ‘/usr/lib/python/site-package/test-easy-install-32288.pth’

The installation directory you specified (via –install-dir, --prefix, or the distutils default setting) was:

/usr/lib/python/site-package/

This directory does not currently exist. Please create it and try again, or choose a different install directory( using the –d or –install-dir option).

Any idea?

Xiao

Hi Xiao,

First, is your easy_install really located in folder
/usr/lib/python/site-package ?
For me (Debian) it is: /usr/bin/easy_install

Second, in Debian the folder containing the 3rd party python packages is
called /usr/lib/python/site-packages (with an "s" at the end).

Third, have you tried to create the folder as stated in the error
message? (But I really think it should be "site-packages" with the
trailing "s")

best,
Tobias

Wang, Xiao wrote:

Hi Tobias,

Yes, you are right I missed "s" at the end of site-package. Now I have installed several obspy modules in the box.

Another question, do I need to install matplotlib before I run easy_install –N obspy.imaging?

Thanks again,

Xiao

Hi Tobias,

After some progresses of the installation, I am stuck again. When I try to install obspy.signal, I got error. Please see the following displayed message when I runscript: /usr/lib/python/site-packages/easy_install -N -d /usr/lib/python/site-packages/ obspy.signal/

The displayed message:
Processing
Running trunk/setup.py -q bdist_egg --dist-dir /home/obspy/obspy.signal/trunk/egg-dist-tmp-qkBZqK
obspy/signal/src/fft/fftpack_litemodule.c:3:31: fatal error: numpy/arrayobject.h: No such file or directory
compilation terminated.
error: Setup script exited with error: command 'gcc' failed with exit status 1

But I have installed numpy. I didn't got any error under python environment when I type import numpy as np.

Could you please help me to work out here.

Thanks,

Xiao

Hi Xiao,

The displayed message:
Processing
Running trunk/setup.py -q bdist_egg --dist-dir /home/obspy/obspy.signal/trunk/egg-dist-tmp-qkBZqK
obspy/signal/src/fft/fftpack_litemodule.c:3:31: fatal error: numpy/arrayobject.h: No such file or directory
compilation terminated.
error: Setup script exited with error: command 'gcc' failed with exit status 1

gcc is complaining that some .h file for numpy is missing.

could you please run in python the following code:

import os
import numpy as np print
os.path.join(os.path.dirname(np.core.__file__), 'include')

and check the resulting directory for numpy/arrayobject.h.

Something went wrong with your numpy installation if this file is missing.

Regards,
Robert

- --

Dr. Robert Barsch
Department of Earth and Environmental Sciences, Geophysics
LMU Munich
Theresienstr. 41/IV
D-80333 Munich
Germany

Tel: +49 (0) 89 2180 4201
Fax: +49 (0) 89 2180 9942010
Mail: barsch@lmu.de

sorry typo - it should be

import os
import numpy as np
print os.path.join(os.path.dirname(np.core.__file__), 'include')

Robert

- --

Dr. Robert Barsch
Department of Earth and Environmental Sciences, Geophysics
LMU Munich
Theresienstr. 41/IV
D-80333 Munich
Germany

Tel: +49 (0) 89 2180 4201
Fax: +49 (0) 89 2180 9942010
Mail: barsch@lmu.de

Please see the following message when I do as your instruction:

xiaowang@linux-5sog:~/Downloads> python
Python 2.6.5 (r265:79063, Jul 5 2010, 11:47:21)
[GCC 4.5.0 20100604 [gcc-4_5-branch revision 160292]] on linux2
Type "help", "copyright", "credits" or "license" for more information.

import os
import numpy as np print

  File "<stdin>", line 1
    import numpy as np print
                           ^
SyntaxError: invalid syntax

os.path.join(os.path.dirname(np.core.__file__), 'include')

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
NameError: name 'np' is not defined

It looks something wrong. Could you please give me further light as I am totally new to Python.

Thanks a lot,

Xiao

please see the following message. There is no error from the output. What is the next step to check further?

xiaowang@linux-5sog:/usr/lib> python
Python 2.6.5 (r265:79063, Jul 5 2010, 11:47:21)
[GCC 4.5.0 20100604 [gcc-4_5-branch revision 160292]] on linux2
Type "help", "copyright", "credits" or "license" for more information.

import os
import numpy as np
print os.path.join(os.path.dirname(np.core.__file__), 'include')

/usr/lib/python2.6/site-packages/numpy/core/include

Xiao

as I said before: "check the resulting directory for numpy/arrayobject.h."

so does the file
"/usr/lib/python2.6/site-packages/numpy/core/include/numpy/arrayobject.h" exist?

If the file is missing: NumPy installation went wrong or some
header/-dev packages are missing if you did not install NumPy manually -
in this case check the package manager of you Linux distribution.

If the file exists: than we have an issue - because to code posted
before is used to find the include directories of numpy and reuse that
within obspy.signal.

Robert

- --

Dr. Robert Barsch
Department of Earth and Environmental Sciences, Geophysics
LMU Munich
Theresienstr. 41/IV
D-80333 Munich
Germany

Tel: +49 (0) 89 2180 4201
Fax: +49 (0) 89 2180 9942010
Mail: barsch@lmu.de

Hello,

numpy header files come with the package python-numpy-devel under SUSE, which is not automatically installed when you install package python-numpy from an opensuse-repository.
My first guess would be (as Robert already wrote) that you don't have the header files installed.

You can get them via "sudo zypper install python-numpy-devel" [supposing you have the necessary repositories...]

If you already have python-numpy-devel installed, I don't know what the problem might be...

Christian

Robert Barsch wrote:

Yes, the problem is I missed the installation of python-numpy-devel. After installation of python-numpy-devel, I can see "/usr/lib/python2.6/site-packages/numpy/core/include/numpy/arrayobject.h".

So far, I installed python 2.6.5, matplotlib 1.0.0, lxml 2.2.6, numpy 1.5.0, scipy 0.8.0 and setuptools 0.6.

I did a initial test in the tutorial from http://www.obspy.org/wiki/ObspyTutorial. It looks good at beginning, but when I call st.plot(color='k'), it complains that "No module named backend_tkagg". But where can I find out this module?

Below is my test message:

xiaowang@linux-5sog:~/Downloads> python
Python 2.6.5 (r265:79063, Jul 5 2010, 11:47:21)
[GCC 4.5.0 20100604 [gcc-4_5-branch revision 160292]] on linux2
Type "help", "copyright", "credits" or "license" for more information.

from obspy.core import read
st=read(‘http://examples.obspy.org/RJOB_061005_072159.ehz.new’)
print st

1 Trace(s) in Stream:
.RJOB..Z | 2005-10-06T07:21:59.849998Z - 2005-10-06T07:24:59.844998Z | 200.0 Hz, 36000 samples

print st[0].stats

         network:
         station: RJOB
        location:
         channel: Z
       starttime: 2005-10-06T07:21:59.849998Z
         endtime: 2005-10-06T07:24:59.844998Z
   sampling_rate: 200.0
           delta: 0.005
            npts: 36000
           calib: 0.0948999971151
         _format: GSE2
            gse2: AttribDict({'instype': ' ', 'datatype': 'CM6', 'hang': -1.0, 'auxid': 'RJOB', 'vang': -1.0, 'calper': 1.0})

st[0].stats.station

'RJOB'

st[0].stats.gse2.datatype

'CM6'

st[0].data

array([-38, 12, -4, ..., -14, -3, -9])

st[0].data[0:3]

array([-38, 12, -4])

len(st[0])

36000

st.plot(color='k')

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/usr/lib/python2.6/site-packages/obspy.core-0.4.5.dev_r2095-py2.6.egg/obspy/core/stream.py", line 763, in plot
    from obspy.imaging.waveform import WaveformPlotting
  File "/usr/lib/python2.6/site-packages/obspy.imaging-0.4.5.dev_r2079-py2.6.egg/obspy/imaging/waveform.py", line 37, in <module>
    import matplotlib.pyplot as plt
  File "/usr/lib/python2.6/site-packages/matplotlib/pyplot.py", line 95, in <module>
    new_figure_manager, draw_if_interactive, show = pylab_setup()
  File "/usr/lib/python2.6/site-packages/matplotlib/backends/__init__.py", line 25, in pylab_setup
    globals(),locals(),[backend_name])
ImportError: No module named backend_tkagg

Thanks,

Xiao

Hi

You should maybe install Tkinter too ...

HTH

Thomas

Hi again,

the package that is now probably missing is python-matplotlib-tk
Christian

I installed python-tk-2.6.5-3.3.1.i586.rpm and python-matplotlib-tk-1.0.0-19.2.i586.rpm. it works now.

Thanks,

Xiao

Hi,

Apology if I put it on a wrong mailing list, but there is no contact information from www.seishub.org.

I tried to install seishub server. I did operations followed the instruction from http://svn.geophysik.uni-muenchen.de/trac/seishub/wiki/InstallingSeisHub. I did a test by running script seishub-runtests. The running result displays fine.

Now I want to run seishub server, the instruction from the above link says "2. Go into seishub/bin and correct the directory paths in the start and stop shell scripts. 3.Start SeisHub. (first start-up creates the configuration file conf/seishub.ini) ". But after I checked out the seishub code from the svn, I just got three directory that are: seishub.core, seishub.plugins.exupery and seishub.plugins.seismology. I cannot find scripts of start/stop or seishub.ini file, Even after I setup seishub by calling : easy_install seishub.core/, easy_install seishub. plugins.exupery/ and easy_install seishub. plugins.seismology/.

So how can I run seishub web server and visit it by Web Browser?

Could anyone give me ideas?

Thanks in advance,

Xiao

Just a guess..

The files that are mentioned might end up in another directory after
installing via easy_install. If you are installing as root I would check
e.g. /usr/lib/python2.5/site-packages

best,
Tobi

Wang, Xiao wrote:

Hi Tobi, thanks for the reply.

I installed the seishub at /usr/lib/python/site-packages via easy_install. I searched installed location, there is not file like start/stop or seishub.ini.

Any idea?

Xiao

Hi Xiao,

main contact for SeisHub would be me.

The installation instructions are written for the tagged version 1.0.3
of SeisHub which is rather outdated if you plan to use the latest ObsPy
packages too.

I recently changed the SeisHub installation procedure to be fully
compatible with easy_install via PyPI - so you need to call only:

easy_install seishub.core==dev
easy_install seishub.plugins.seismology==dev

It will also install a script called seishub-admin within your Python
environment. Call this script to initialize a new SeisHub environment

seishub-admin initenv /path/to/instance

You don't need to adjust any paths anymore - also the installer allows
to create multiple SeisHub instances in multiple sub directories (if
needed).

After that change to the bin directory within the instance path
(/path/to/instance/bin) and run start.sh to start the server. After that
you should be able to connect to the local server via
http://localhost:8080/manage.

You probably want to stop the server after the first run and adjust the
settings within the configuration file seishub.ini within the conf
directory or use the web interface for that.

As the installation script is not fully tested yet I expect it to have
bugs - so please report back if you hit an issue. If not its time to
update the installation page and add proper contact information too :wink:

Cheers,
Robert

Hi Tobi, thanks for the reply.

I installed the seishub at /usr/lib/python/site-packages via easy_install. I searched installed location, there is not file like start/stop or seishub.ini.

Any idea?

Xiao

- --

Dr. Robert Barsch
Department of Earth and Environmental Sciences, Geophysics
LMU Munich
Theresienstr. 41/IV
D-80333 Munich
Germany

Tel: +49 (0) 89 2180 4201
Fax: +49 (0) 89 2180 9942010
Mail: barsch@lmu.de

Hi Robert,

Now it works. Excellent!

A quick question: what is the default username and password when I visit http://localhost:8080/manage?

Thanks,

Xiao

Default is "admin"/"admin".

best,
Tobias

Wang, Xiao wrote: