Windows 上的 Python 和 Virtualenv [英] Python and Virtualenv on Windows

查看:34
本文介绍了Windows 上的 Python 和 Virtualenv的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何在 windows 上正确安装 virtualenv?

How do you install virtualenv correctly on windows?

我从这里下载了 virtualenv1.9.1 并尝试安装:

I downloaded virtualenv1.9.1 from here and tried installing it with:

python virtualenv.py install

但它没有出现在 MyPythonPath/Scripts

but it does not appear in MyPythonPath/Scripts

我尝试以相同的方式安装 virutalenvwrapper-win 并且安装正确.但是我不能使用它,因为我没有 virtualenv

I tried the same way installing virutalenvwrapper-win and it installed correctly. But I can't use it because I don't have virtualenv

python.exe:无法打开文件'MyPythonPath\Scripts\virtualenv-script.py': [Errno 2] 没有这样的文件或目录

python.exe: can't open file 'MyPythonPath\Scripts\virtualenv-script.py': [Errno 2 ] No such file or directory

推荐答案

安装 Python 包的推荐方式是使用 pip

The suggested way to install Python packages is to use pip

请按照此文档安装 pip:https://pip.pypa.io/en/latest/installing/

注意:Python 2.7.9 及更高版本,Python 3.4 及更高版本已经包含 pip.

Note: Python 2.7.9 and above, and Python 3.4 and above include pip already.

然后安装virtualenv:

pip install virtualenv

这篇关于Windows 上的 Python 和 Virtualenv的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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