Windows 上的 virtualenv 安装在系统站点包中 [英] virtualenv on windows installs in system site packages

查看:31
本文介绍了Windows 上的 virtualenv 安装在系统站点包中的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我通过以下步骤使用 virtualenv 初始化我的项目(在 Windows 7 操作系统中):

I initialize my project with virtualenv through these steps(in Windows 7 OS):

$ cd myproject
$ virtualenv venv
$ venv\scripts\activate

然后我尝试安装 flask

$ pip install Flask

但我发现 flask 没有安装在我的 /venv/lib/site-packages 文件夹中

but I found the flask isn't install in my /venv/lib/site-packages folder

它仍然安装在我的 C:/Python27/lib/site-packages 文件夹中

it is still install in my C:/Python27/lib/site-packages folder

这是正确的吗?我认为它应该安装在 venv 文件夹中

Is this correct? I think it should be install in the venv folder

如果这是不正确的,我该怎么办?

If this is incorrect, what should I do?

推荐答案

从 CMD 开始.仅使用 CMD 重新创建您的 virtualenv.然后执行 pip freeze.现在应该可以了.git-bash 不工作的原因是因为它只有 git 的 PATH,没有别的.

Start over with CMD. Recreate your virtualenv using only CMD. Then do a pip freeze. Things should work now. The reason why git-bash does not work is because it has only the PATH for git, and nothing else.

这篇关于Windows 上的 virtualenv 安装在系统站点包中的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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