安装 python 包以纠正 anaconda 环境

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/22312665/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-19 00:44:27  来源:igfitidea点击:

Install python packages to correct anaconda environment

pythonsetup.pyanaconda

提问by Andreas Dolk

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

我已经设置了 anaconda 并创建了一个 python 3.3 环境。现在我想安装一些包(dataset)。安装说明要求克隆 git repo 并运行

python setup.py install

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

但是现在这些包没有安装到环境站点包文件夹中,而是安装到了不同的 anaconda 位置。

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

解决该问题的正常步骤是什么?新手兼容的解决方案是首选。操作系统是 MacOSX,只是个案,它是相关的。

采纳答案by user545424

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

看起来 conda 会自动将 pip 添加到您的 conda 环境中,因此在您获取 conda 环境后,即:

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/