gpt4 book ai didi

django - pyvenv 和 pip 未安装到本地站 pip 包中

转载 作者:行者123 更新时间:2023-12-04 23:23:23 27 4
gpt4 key购买 nike

我正在测试驱动 Django 1.6b、Python 3.3.2(从源代码编译)和 pyvenv使用 Ubuntu 12.04。

每次我尝试安装时执行 pip install [package]该软件包尝试在全局范围内自行安装,而不是安装到我的本地环境中。一个简单的工作流程如下:
$ pyvenv environments/roebk$ source environments/roebk/bin/activate$ (roebk) pip install southerror: could not create '/usr/local/lib/python3.3/site-packages/south': Permission denied
我已经仔细检查过我使用的是正确版本的 pip。
$ pip -V
pip 1.4 from /usr/local/lib/python3.3/site-packages/pip-1.4-py3.3.egg (python 3.3)

我错过了什么明显的东西吗?

最佳答案

你安装了吗setuptoolspip进入环境? virtualenv安装 setuptoolspip自动进入新环境。

$ virtualenv qwerty
qwerty/bin/python 中的新 python 可执行文件
安装 setuptools……完成。
安装pip…………完成。
$

根据pyvenv docs您需要手动将它们安装到新环境中。

Common installation tools such as Distribute and pip work as expected with venvs - i.e. when a venv is active, they install Python packages into the venv without needing to be told to do so explicitly. Of course, you need to install them into the venv first: this could be done by running distribute_setup.py with the venv activated, followed by running easy_install pip. Alternatively, you could download the source tarballs and run python setup.py install after unpacking, with the venv activated.

关于django - pyvenv 和 pip 未安装到本地站 pip 包中,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/17982032/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com