Mac OSX - Eclipse - PyDev troubles

Hi there!!
I’m having a little bit of troubles trying to run a basic (1 line!!) scrips with obspy in the cited environment.

My interpreter is Python 2.7

Here’s the script:

import obspy
st ='’)
print st

And here are the errors I get:

Traceback (most recent call last):
File “/Users/andreabono/Eclipse Projects/pippo/package1/”, line 7, in
import obspy
File “/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/obspy/”, line 38, in
version = _getVersionString(abbrev=10)
File “/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/obspy/core/util/”, line 147, in get_git_version
release_version = read_release_version()
File “/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/obspy/core/util/”, line 133, in read_release_version
with, “rt”) as fh:
LookupError: unknown encoding:

I’m working with Mac OS X Yosemite and installed Python and obspy through MacPorts.
Can anyone help?


Hi Andrea

Actually it would be enough with the line:
import obspy
to raise the exception

This is most likely the same error as reported by Pascal Audet begining of this month (see the mailing list archive thread “Error Upgrading to Obspy 0.10.2_2 from 0.9.2_0”, for more info) and the dev-team is most likely working on a solution to it.

For now a workaround may be to edit line 133 in
to read:
������� with, “rt”, encoding=“UTF-8”) as fh:
(or whatever encoding is appropriate for your system)


Hi Andrea,

I will look at this as soon I am back in the institute.
This problem seems to be specific to Yosemite, where encoding is not set to a reasonable default. I was not able to reproduce it and got not enough info to understand the original cause.

That’s great!!
It working now!!

Thanks a lot!!

Dear all,

I would like to mark phase arrivals in a waveform plot using ObsPy. My approach so far is to create a Figure instance, plot the waveforms to this Figure using the ObsPy plot function and then add lines to mark the arrivals. It looks something like this:

import matplotlib.pyplot as plt
data = read(Stream with several Traces)
fig = plt.figure()
plt.axvline(x, stuff)

However, this way the line is plotted only on top of the very last Trace, not all of them. I guess it is because I am not plotting to the correct subplot?

Is it possible to plot something on top of any of the Traces in the Stream? Alternatively: Do you maybe know a better way to do what I have in mind? I wanted to make use of the convenient .plot() function, but maybe for this type of task it is not the best idea after all?

Thanks a lot and best regards,


pyplot convenience routines usually plot in the currently active axes,
which happens to be the last axes in the stream plot figure.
You can use `fig.axes` (which is a list of axes) to access all of them,
and directly issue the plot commands to the respective axes e.g.:

for ax in fig.axes:


  I had the same problem using and IDE wherelocale.getprefferedencoding() returns an empty string. I reported it to, and it was confirmed. However, I don't see anyone pressing to fix it.
  The bug report is here
  Another work around is by setting one of these env vars: 'LANGUAGE', 'LC_ALL', 'LC_CTYPE', and 'LANG'