49

I've setup anaconda and created a python 3.3 environment. Now I wanted to install some package (dataset). The install instructions ask to clone the git repo and run

python setup.py install

but now the packages are not installed to the environments site-packages folder but to a different anaconda location.

What are the normal steps to solve that problem? Newbie-compatible solutions are preferred. The OS is MacOSX, just is case, it is relevant.

Andreas Dolk
  • 113,398
  • 19
  • 180
  • 268

1 Answers1

40

It looks like conda automatically adds pip to your conda environment, so after you source your conda environment, i.e.:

source activate ~/anaconda/envs/dataset

you should be able to install it like this:

git clone git://github.com/pudo/dataset.git
pip install ./dataset

EDIT

Here are the exact steps I took:

$ conda create -p ~/anaconda/envs/py33 python=3.3 anaconda pip
$ source activate ~/anaconda/envs/py33
$ which pip
~/anaconda/envs/py33/bin/pip
$ pip install ./dataset/
asmeurer
  • 86,894
  • 26
  • 169
  • 240
user545424
  • 15,713
  • 11
  • 56
  • 70
  • 3
    Sorry, doesn't work - the env is called py3k and there is no bin/activate in that environment. I've activated it though. And `pip install ./dataset` installs to `~/anaconda/lib/python2.7/site-packages` like `python setup.py install` but I need the packages in `~/anaconda/envs/py3k/lib/python3.3/site-packages` – Andreas Dolk Mar 10 '14 at 22:52
  • @Andreas_D, was pip included in your conda installation? – user545424 Mar 10 '14 at 22:59
  • 1
    My guess is that pip wasn't included in your py3k environment. Try `conda install pip` in that environment first. It works for me, although I'm not on a Mac. – user545424 Mar 10 '14 at 23:02
  • Now I've executed `conda install -n py3k pip` and it looked like it installed some py33 related packages. But `pip install ./dataset` still uses the python2.7 path (and reports requirements already satisfied) – Andreas Dolk Mar 10 '14 at 23:07
  • What version are you using? I've got `conda 3.0.6`. – user545424 Mar 10 '14 at 23:11
  • 1
    Strike!! I've activated the environment again(!) and now it runs like a charm. Thanks a lot for your patience! (Reason for fail: the `~/.profile` exported a wrong path, didn't point to the environment) – Andreas Dolk Mar 10 '14 at 23:14
  • Usually just doing `source activate py33` will work. ? – Andy Hayden Apr 30 '14 at 16:23
  • I thought you're not supposed to use pip with conda? – endolith Feb 20 '16 at 22:38
  • It does not work very well if you have a package that requires native compilation. – sophros Jul 20 '17 at 14:55
  • I have tried many tricks, but none worked! The effortless way to solve this, for now, is just to copy the installed folder from the wrong environment to the equivalent folder in your targeted environment. – Mohammad Javad Mar 29 '21 at 03:40