23

Just downloaded and installed anaconda 3.6.2 on Mac OSX Mavericks and I need to install a package seaborn which is not pre-installed with anaconda.

$ conda install seaborn
Fetching package metadata: ..
Error: No packages found in current osx-64 channels matching: seaborn

You can search for this package on Binstar with

    binstar search -t conda seaborn

You may need to install the Binstar command line client with

    conda install binstar

Next I tried to use pip to install the package

$ which pip
/Users/username/anaconda/bin/pip

$ pip install seaborn
Could not find an activated virtualenv (required).

Tried activating root Anaconda env again, but still does not work

$ source activate root
discarding /Users/username/anaconda/bin from PATH
prepending /Users/username/anaconda/bin to PATH

$ pip install seaborn
Could not find an activated virtualenv (required).

Next I tried activating a virualenv and pip install works.

workon testEnv
pip install seaborn

Now I launched iPython notebook from Anaconda's launcher. But the seaborn package does not seem to be found!

Was the seaborn package really installed?

enter image description here

In ~/bashprofile, I have:

# virutalenvwrapper
export WORKON_HOME=$HOME/.virtualenvs
source /Users/username/.virtualenvs/datasci/bin/virtualenvwrapper.sh

# added by Anaconda 2.0.1 installer
export PATH="/Users/username/anaconda/bin:$PATH"

Update

Removed the 2 virtualenvwrapper lines, reloaded .bash_profile, but pip install still gives the error Could not find an activated virtualenv (required). Activating another conda environment source activate testenv does not help.

$ source activate ~/.bash_profile
$ pip install seaborn
Could not find an activated virtualenv (required).

$ source activate testenv
discarding /Users/username/anaconda/bin from PATH
prepending /Users/username/anaconda/envs/testenv/bin to PATH
$ pip install seaborn
Could not find an activated virtualenv (required).
1
  • did you solve this problem ? Commented Jan 12, 2015 at 19:03

5 Answers 5

32

You need to install the anaconda version of pip. Just run:

conda install pip

This will install pip inside of the activated conda environment

2
  • 4
    After "conda install pip", I discovered that I needed to deactivate and then re-activate, to get pip to work on the conda environment I was in. Symptom was that even though 'which pip' showed the correct executable under anaconda, it was referencing /usr/local/lib/python2.7/site-packages. Deactivate/activate corrected this. Commented Jan 1, 2015 at 0:50
  • 2
    another thing you could do is install pip when you create the conda environment. Just append pip to the end of your conda create command Commented Jan 2, 2015 at 11:01
24

I Had the same problem installing ggplot using Mac. If you execute from Terminal:

/anaconda/bin/pip install module_name

it works. I hope it can help!

MC

2
  • I have a similar problem as the poster. But I have no pip executable in //anaconda/bin/pip. I only have a conda-pipbuild executable. But if I do conda install pip it says All requested packages already installed. # packages in environment at //anaconda:
    – Ben
    Commented Oct 30, 2015 at 16:32
  • 3
    I just did ~/Anaconda/envs/env_name/bin/pip install module_name. Commented May 27, 2016 at 8:04
3

Remove the virtualenvwrapper lines from your bashprofile. With Anaconda, you should use conda environments instead of virtualenvs, and using virtualenvs can end up breaking your conda environments.

3
  • Removed the 2 virtualenvwrapper lines, reloaded .bash_profile by using source ~/.bash_profile. pip install still gives the error Could not find an activated virtualenv (required). Activating another conda environment source activate testenv does not help
    – Nyxynyx
    Commented Aug 25, 2014 at 23:31
  • Strictly speaking, sourcing your bash profile doesn't reload it, it just runs it again. But the environment variables that were set from the virtualenv script will still be set. You should start a new terminal session.
    – asmeurer
    Commented Aug 25, 2014 at 23:55
  • I quit the Terminal program and launched it again. Still getting the error Could not find an activated virtualenv (required). when doing the pip install
    – Nyxynyx
    Commented Aug 26, 2014 at 0:16
0

Maybe just put this in your bash_profile:

export PIP_REQUIRE_VIRTUALENV=false

That was my issue, I forgot that I had set up PIP this way.

-1

Try entering the command in Anaconda Prompt and not Command Prompt.

1
  • 2
    This is irrelevant, as OP already has anaconda on $PATH: export PATH="/Users/username/anaconda/bin:$PATH"
    – Alex.U
    Commented Jun 23, 2018 at 11:46

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.