2

I just installed Anaconda on Mac OSX Yosemite and I have it up and running, including Python, although I think there is something wrong with my paths when I try to "pip install" new modules.

Both "which python" and "which pip" commands point to my Anaconda folder. Moreover, doing a "pip install webbpsf" seems to go through but the module does not appear in the "conda list" nor does it get imported when I run my script (ImportError: no module named webbpsf).

I tried to install the webbpsf module manually (from the downloaded module directory) using "python setup.py install" but I'm getting an error that I believe is pointing to the source of the problem, namely the /username/py-lib/ path. See below:

Checking .pth file support in /username/py-lib/
/username/anaconda/bin/python -E -c pass
TEST FAILED: /username/py-lib/ does NOT support .pth files
error: bad install directory or PYTHONPATH
You are attempting to install a package to a directory that is not
on PYTHONPATH and which Python does not read ".pth" files from. The
installation directory you specified (via --install-dir, --prefix, or
the distutils default setting) was:
/username/py-lib/
and your PYTHONPATH environment variable currently contains:
'/username/anaconda/lib/python2.7/site-packages'
Here are some of your options for correcting the problem:
* You can choose a different installation directory, i.e., one that is
 on PYTHONPATH or supports .pth files
* You can add the installation directory to the PYTHONPATH environment
 variable. (It must then also be on PYTHONPATH whenever you run
 Python and want to use the package(s) you are installing.)
* You can set up the installation directory to support ".pth" files by
 using one of the approaches described here:
 https://pythonhosted.org/setuptools/easy_install.html#custom-installation-locations

I dug deep to try to find where/how this /py-lib/ path is set and I looked into the recommended link to no avail. What am I missing here?

asked Feb 13, 2016 at 1:18
1

2 Answers 2

1

My problem was that the directory /username/py-lib/ (and also /username/py-bin/) were forcefully set in ~/.pydistutils.cfg. I remove the file and "pip install whatever_module" does what it's supposed to do.

answered Feb 13, 2016 at 20:23
Sign up to request clarification or add additional context in comments.

Comments

0

Try using the python bin file in the anaconda folder to install the setup.py file.

answered Feb 13, 2016 at 4:40

1 Comment

Just tried and same error message. There must be some configuration for python setup.py install that sets the problematic directory, but I can't seem to find it.

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

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.