安装python包以纠正anaconda环境

2022-01-10 00:00:00 python setup.py anaconda

问题描述

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

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

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

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

解决该问题的常规步骤是什么?新手兼容的解决方案是首选.操作系统是MacOSX,只是大小写,是相关的.

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


解决方案

看起来 conda 会自动将 pip 添加到你的 conda 环境中,所以在你 source 你的 conda 环境之后,即:

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

编辑

以下是我采取的具体步骤:

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/

相关文章