繁体   English   中英

将Pip安装到错误的虚拟环境

[英]Pip installing to wrong virtual environment

我有两个Django项目,每个项目都有一个名为myvenv的虚拟环境。 我正在尝试使用pip安装名为psycopg2的软件包。 即使which pip命令确认pip在正确的虚拟环境中运行,它仍安装在错误的虚拟环境中。

我重新启动了Mac,以便在没有运行任何虚拟环境的情况下启动。 当我尝试使用pip时,我的终端日志如下所示:

BillMacBookPro:~ billnoble$ cd ~/documents/yhistory-server
BillMacBookPro:yhistory-server billnoble$ source ~/documents/yhistory-    server/myvenv/bin/activate
(myvenv) BillMacBookPro:yhistory-server billnoble$ which pip
/Users/billnoble/Documents/YHistory-Server/myvenv/bin/pip
(myvenv) BillMacBookPro:yhistory-server billnoble$ brew install postgresql
Warning: postgresql-9.4.4 already installed
Warning: You are using OS X 10.11.
We do not provide support for this pre-release version.
You may encounter build failures or other breakage.
(myvenv) BillMacBookPro:yhistory-server billnoble$ pip install psycopg2
Requirement already satisfied (use --upgrade to upgrade): psycopg2 in /Users/billnoble/Documents/VeeUServer/myvenv/lib/python3.4/site-packages
You are using pip version 8.1.1, however version 8.1.2 is available.
You should consider upgrading via the 'pip install --upgrade pip' command.

我已经在YHistory-Server目录中成功启动了我的虚拟环境,并且which pip确认它正在此虚拟服务器上运行。 但是,当我运行pip时,它抱怨该软件包安装在计算机上的另一个虚拟环境中。 为什么使用错误的路径名? 如何使其安装在正确的虚拟环境中?

我想当您创建第二个virtualenv时,您已经激活了第一个,并且可能将它们链接在一起。 尝试重新创建虚拟环境,然后在创建第二个虚拟环境时,请确保停用首先创建的第一个虚拟环境。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM