1

I am attempting to install PyMC using pip install pymc. I believe this command should install PyMC 2.3.6.

PyMC has a few dependencies, which I have in my PATH. I am running OSX 10.11.2 and my PATH includes Python 2.7.13, NumPy 1.12.0, Matplotlib 2.0.0, gcc, and gfortran.

Python (including pip) was installed using Homebrew. NumPy and Matplotlib were installed using pip. The gfortran compiler was downloaded and installed from the GCC Wiki for the purpose of this installation.

Executing pip install pymc yielded lots of output including the following lines.


Collecting pymc
  Using cached pymc-2.3.6.tar.gz
    Complete output from command python setup.py egg_info:
    running egg_info
    running build_src
    build_src
    building extension "pymc.flib" sources
    f2py options: ['skip:ppnd7']
    f2py:> build/src.macosx-10.11-x86_64-2.7/pymc/flibmodule.c
    creating build
    creating build/src.macosx-10.11-x86_64-2.7
    creating build/src.macosx-10.11-x86_64-2.7/pymc
    IOError: [Errno 2] No such file or directory: 'skip:ppnd7'. Skipping file "skip:ppnd7".
    updatevars:gradlike: attempt to change 'dimension(nx)' to 'dimension(na)'. Ignoring.
    updatevars:gradlike: attempt to change 'dimension(nx)' to 'dimension(nb)'. Ignoring.
    updatevars:gradlike: attempt to change 'dimension (nmu)' to 'dimension(nmu)'. Ignoring.
    updatevars:gradlike: attempt to change 'dimension (na)' to 'dimension(na)'. Ignoring.
    rmbadname1: Replacing "index" with "index_bn".
    Reading fortran codes...
        Reading file 'pymc/flib.f' (format:fix,strict)
    Line #34 in pymc/flib.f:"      PARAMETER (infinity = 1.7976931348623157d308)"
        get_parameters: got "unexpected EOF while parsing (<string>, line 0)" on ''

...

Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "/private/var/folders/2f/cr97n5v93mn04c3qbqd7r3q40000gn/T/pip-build-6Zmgcz/pymc/setup.py", line 124, in <module>
    **(config_dict))
  File "/usr/local/lib/python2.7/site-packages/numpy/distutils/core.py", line 169, in setup
    return old_setup(**new_attr)

...

    ----------------------------------------
Command "python setup.py egg_info" failed with error code 1 in /private/var/folders/2f/cr97n5v93mn04c3qbqd7r3q40000gn/T/pip-build-6Zmgcz/pymc/

As suggested in these two pip installation threads about egg_info errors [1, 2], I ran pip install —upgrade setuptools and pip install ez_setup. Once these items were installed I ran into the same types of errors pasted above.

As noted in other package installation threads, I am willing to use conda to install PyMC if I cannot resolve these issues. However, I'd like to investigate this installation issue first.

Would anyone happen to know what my issue is here? Might there be some steps I can take to successfully install PyMC using pip?

Community
  • 1
  • 1

2 Answers2

0

I had the same problem. I don't understand the root cause, but I fixed it by downgrading numpy to version 1.10.1: pip install numpy==1.10.1

0

I also met this problem while trying to install pymc from pip or source code, but I found a solution that might be useful. The reason that causes the problem might be the file setup.py, in which the script check the compile env. I didn't read the code very carefully, but in the function build_ext() I think the codes first check whether some compile environments have already been installed into OS. If installed, the script will use them as defaults; if not, use ones in somewhere else (the comment says 'from netlib sources').

I infer the problem is caused by the compile environments that have already been installed in the OS, so I modify the file setup.py to skip this part of codes, and let the script use the netlib source. Then I run sudo python setup.py install. There are some error and warning messages, but the folder 'pymc' emerges in python library, and some simple test codes run successfully.

Shreyash S Sarnayak
  • 2,309
  • 19
  • 23