Dylan Hettinger
Dylan Hettinger

Reputation: 795

Install module using pip within Anaconda environment

I've recently transitioned to an Anaconda environment on RHEL6, but I need a module not in the conda repository. So I install it with pip:

(gt_keys)[user@server gtkey]$ which pip
/srv/home/shared/anaconda/envs/gt_keys/bin/pip

(gt_keys)[user@server gtkey]$ pip install owslib
Downloading/unpacking owslib
Downloading OWSLib-0.8.3.tar.gz (97kB): 97kB downloaded
Running setup.py egg_info for package owslib

Requirement already satisfied (use --upgrade to upgrade): python-dateutil>=1.5 in /srv/home/shared/anaconda/lib/python2.7/site-packages (from owslib)
Requirement already satisfied (use --upgrade to upgrade): pytz in /srv/home/shared/anaconda/lib/python2.7/site-packages (from owslib)
Requirement already satisfied (use --upgrade to upgrade): pytest in /srv/home/shared/anaconda/lib/python2.7/site-packages (from owslib)
Requirement already satisfied (use --upgrade to upgrade): pytest-cov in /srv/home/shared/anaconda/lib/python2.7/site-packages (from owslib)
Requirement already satisfied (use --upgrade to upgrade): PIL in /srv/home/shared/anaconda/lib/python2.7/site-packages/PIL (from owslib)
Requirement already satisfied (use --upgrade to upgrade): cov-core>=1.6 in /srv/home/shared/anaconda/lib/python2.7/site-packages (from pytest-cov->owslib)
Requirement already satisfied (use --upgrade to upgrade): coverage>=3.4 in /srv/home/shared/anaconda/lib/python2.7/site-packages (from cov-core>=1.6->pytest-cov->owslib)
Installing collected packages: owslib
  Running setup.py install for owslib

Successfully installed owslib
Cleaning up...

But it doesn't work in my environment:

(gt_keys)[user@server gtkey]$ which python
/srv/home/shared/anaconda/envs/gt_keys/bin/python

(gt_keys)[user@server gtkey]$ python -c 'import owslib'
    Traceback (most recent call last):
      File "<string>", line 1, in <module>
    ImportError: No module named owslib

owslib only made it to the base Ananaconda install:

sh-4.1$ which python
/srv/home/shared/anaconda/bin/python
sh-4.1$ python -c 'import owslib'

What am I doing wrong?

Upvotes: 1

Views: 6377

Answers (1)

Dylan Hettinger
Dylan Hettinger

Reputation: 795

I don't know why, but this time it worked:

pip install owslib --allow-external PIL --allow-unverified PIL

I would be interested, still, in any comments on my process. Something strange was happening that was resolved when I reconnected to the server this morning after failing last night. Must be something with the path.

Upvotes: 1

Related Questions