3

I have pymc installed, and I am now trying to import it in my code. However,

First when I do import pymc, I got the error message:

    Traceback (most recent call last):
    File "<stdin>", line 1, in <module>
    File "//anaconda/lib/python2.7/site-packages/pymc-2.3.3-py2.7-macosx-10.9-x86_64.egg/pymc/__init__.py", line 30, in <module>
      from .CommonDeterministics import *
    File "//anaconda/lib/python2.7/site-packages/pymc-2.3.3-py2.7-macosx-10.9-x86_64.egg/pymc/CommonDeterministics.py", line 21, in <module>
      from .utils import safe_len, stukel_logit, stukel_invlogit, logit, invlogit, value, find_element
    File "//anaconda/lib/python2.7/site-packages/pymc-2.3.3-py2.7-macosx-10.9-x86_64.egg/pymc/utils.py", line 14, in <module>
      from . import flib
    ImportError: numpy.core.multiarray failed to import

which can be fixed by manually import numpy.core.multiarray, but then, when I try again to import pymc, I got another error message:

    Traceback (most recent call last):
    File "<stdin>", line 1, in <module>
    File "//anaconda/lib/python2.7/site-packages/pymc-2.3.3-py2.7-macosx-10.9-x86_64.egg/pymc/__init__.py", line 30, in <module>
      from .CommonDeterministics import *
    File "//anaconda/lib/python2.7/site-packages/pymc-2.3.3-py2.7-macosx-10.9-x86_64.egg/pymc/CommonDeterministics.py", line 13, in <module>
      from . import PyMCObjects as pm
    ImportError: cannot import name PyMCObjects

I googled around, and the solutions to similar problems are either:

  1. In case that's related to the installation of pymc, force using the 32-bit instead of 64. However, this answer is for Windows users, and I have OS X 10.9 (Mavericks).
  2. In other cases, it's usually due to a circular dependency (for example, here), which I don't think is the case here.

My guess is that something is wrong with the package flib, but I couldn't figure out what. I would appreciate any answer/hint on this problem. Thanks in advance!

Update (July-4-2014) Thanks, Chris! I rebuilt my pymc using the conda build by doing conda install -c https://conda.binstar.org/tobeplugged pymc, and now when I do import pymc, a different error message appears:

  Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "//anaconda/lib/python2.7/site-packages/pymc-2.3.3-py2.7-macosx-10.9-x86_64.egg/pymc/__init__.py", line 44, in <module>
    from . import CommonDeterministics
  ImportError: cannot import name CommonDeterministics

As Chris pointed out (see comments below), the problem(s) is being looked at here. The problem seems to have to do with the version of gcc (version 4.9). I will try to rebuild my gcc with the older version (4.8.2) later today to see if that will solve the problem for OS X 10.9 (Mavericks). Otherwise, I believe people can wait a little bit for the pymc team to solve this problem, too.

4
  • I just built and uploaded this new package yesterday. When I get a chance, I will see if I can replicate the problem, and get back to you. Commented Jul 2, 2014 at 19:29
  • That would be great! Thanks. Commented Jul 3, 2014 at 13:02
  • I cannot replicate it, but it appears that others can. Commented Jul 3, 2014 at 18:46
  • Thanks! Please see updates above. Thank you for passing the problem over to the pymc github. Commented Jul 4, 2014 at 7:44

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.