pip:找不到激活的 virtualenv(必需) [英] pip: Could not find an activated virtualenv (required)

查看:21
本文介绍了pip:找不到激活的 virtualenv(必需)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试在 mac osx 10.8.3 上安装 virtualenv 和/或 virtualenvwrapper

I am trying to instal virtualenv and/or virtualenvwrapper on a mac osx 10.8.3

这两天我一直在和python打架.最后我能够使用 brew 安装 python 2.7.4.在我使用 easy_install 安装 virtualenv 之前.然后我尝试卸载它,试图让我的电脑和我的一位同事处于相同的情况.也许我成功卸载了它,也许没有.我不知道如何测试它.现在我应该使用 -

I have been fighting with python for the last two days. Finally I was able to install python 2.7.4 using brew. Before I had virtualenv installed using easy_install. Then I tried to uninstall it, trying to get my computer in the same situation as the one of my colleagues. Maybe I uninstalled it with success, maybe not. I don't know how to test it. Now I am supposed to install virtualenv using -

pip install virtualenv

但它给了我 -

Could not find an activated virtualenv (required).

pip install virtualenvwrapper 给出完全相同的输出.

pip install virtualenvwrapper gives exactly the same output.

还有变量:PIP_RESPECT_VIRTUALENV 为空:

echo $PIP_RESPECT_VIRTUALENV

我该如何解决这个问题?

How can I solve this issue?

谢谢

推荐答案

打开你的 ~/.bashrc 文件,看看有没有这一行 -

Open your ~/.bashrc file and see if this line is there -

export PIP_REQUIRE_VIRTUALENV=true

这可能是造成问题的原因.如果它在那里,将其更改为 false 并运行 -

It might be causing the trouble. If it's there, change it to false and run -

source ~/.bashrc

如果没有,从终端运行export PIP_REQUIRE_VIRTUALENV=false.

If not, run export PIP_REQUIRE_VIRTUALENV=false from terminal.

注意:如果您在当前用户的根目录中有 .bash_profile 而不是 .bashrc,一切都一样.

Note: everything works the same if you have .bash_profile instead of .bashrc in your current user's root directory.

这篇关于pip:找不到激活的 virtualenv(必需)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆