subprocess32

Dear all,

I’ve just undated obspy using MacPorts by following the explanations of

Now I get the following error message when I try to import obspy.
It seems to say that subprocess32 is missing.
I would appreciate any advice..
Regards,
Akiko

import obspy
Traceback (most recent call last):

  File "<stdin>", line 1, in <module>
  File "/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/obspy/__init__.py", line 43, in <module>
    read.__doc__ % make_format_plugin_table("waveform", "read", numspaces=4)
  File "/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/obspy/core/util/base.py", line 391, in make_format_plugin_table
    "obspy.plugin.%s.%s" % (group, name), method)
  File "/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/pkg_resources/__init__.py", line 561, in load_entry_point
    return get_distribution(dist).load_entry_point(group, name)
  File "/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/pkg_resources/__init__.py", line 2631, in load_entry_point
    return ep.load()
  File "/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/pkg_resources/__init__.py", line 2290, in load
    self.require(*args, **kwargs)
  File "/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/pkg_resources/__init__.py", line 2307, in require
    items = working_set.resolve(reqs, env, installer)
  File "/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/pkg_resources/__init__.py", line 849, in resolve
    raise DistributionNotFound(req, requirers)
pkg_resources.DistributionNotFound: The 'subprocess32' distribution was not found and is required by matplotlib

Dear Akiko,
thanks for letting us know! I’ll look into this ASAP.

My first impression here is that this issue is not directly related to Obspy, but rather to matplotlib in Macports. Obspy @Macports has been extensively tested and has not changed recently.

In case you manage to figure out such bug are related to some port (or somehow) to Macports, please consider to file a ticket with that project: https://trac.macports.org/newticket (Not this time, I’ll take care of it :wink: ). It’s perfectly fine to drop us a note in case you are not sure.

Cheers!
~petr

Dear Peter,

Thank you for the reply. Indeed it looked like a problem with marplotlib and Macports.

I used “pip” and now it looks working. Below I’d just like to list what I did.

  • First I once completely uninstalled macports and re-installed everything following the procedure shown in
    https://github.com/obspy/obspy/wiki/Installation-on-Mac-OS-X-using-Macports
    However, the problem with “subprocess32” was still there.

  • Then I downloaded get-pip.py from https://bootstrap.pypa.io/get-pip.py then
    % sudo python get-pip.py
    % sudo python -m pip install subprocess32

  • I also encountered the problem mentioned in this mailing-list around September 2015 with title “Mac OS X - Eclipse - PyDev troubles”. I guess this is unrelated to the “subprocess32” problem, but related to the fact I use Mac OS X Yosemite.
    I modified a few lines in
    /opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/obspy/core/util/version.py
    /opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/obspy/geodetics/flinnengdahl.py
    following the suggestion of changing to
    with io.open(VERSION_FILE, “rt", encoding=“UTF-8”) as fh:

I’m not sure whether using pip was a good way to get around the problem, but so far it is working.
Regards,
Akiko