在Windows下安装pip

来源:互联网 发布:软件著作权申请登记 编辑:程序博客网 时间:2024/06/05 04:28

原始链接:http://stackoverflow.com/questions/4750806/how-to-install-pip-on-windows

pip is a tool for installing and managing Python packages, such as those found in the Python Package Index. It’s a replacement for easy_install.

本部分介绍两个:

一、Python3.4.x下的pip

二、Python2.7.x下的pip(我就不信了!我在Python2.7中就成功不了!)

一、改用Python3.4.1

之前用的是Python2.7.4,所以要装pip

昨天晚上攻到2点安装pip,殊不知今天早晨用pip install virtualenv出现error

在stackoverflow中找到关于在Windows下面安装pip的帖子

http://stackoverflow.com/questions/4750806/how-to-install-pip-on-windows 提到Python3.4.x 系统中集成了pip,于是装了Python3.4.1

安装好了之后设置好环境变量,在cmd中执行pip install virtualenv

成功安装!

二、重新在Python2.7中安装pip(我就不信了!还成功不了!)

回到http://stackoverflow.com/questions/4750806/how-to-install-pip-on-windows

这个帖子中教我们安装pip的方法是:

点击get-pip.py获得代码,然后我们自己创建一个.py文件(比如说我们还是创建get-pip.py),将代码复制进去,然后用管理员的身份运行cmd(我之前的错误就是没有这么做)。然后执行get-pip.py(我这儿已经在环境变量中设置好了,可以在http://www.cnblogs.com/qiyeshublog/archive/2012/01/24/2329162.html参考)

这样就安装好了pip!

试一下,在cmd安装virtualenv:

成功安装vitualenv!

在C:\Python27\Scripts和C:\Python27\Lib\site-packages文件夹中也可以看见virtualenv。

0 0