在安装了 python 2.7 和 3.5 的 Windows 上使用 pip [英] Using pip on Windows installed with both python 2.7 and 3.5

查看:46
本文介绍了在安装了 python 2.7 和 3.5 的 Windows 上使用 pip的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用的是 Windows 10.目前,我安装了 Python 2.7.我也想安装 Python 3.5.但是,如果我同时安装了 2.7 和 3.5,当我运行 pip 时,如何将要安装的包直接安装到所需的 Python 版本?

I am using Windows 10. Currently, I have Python 2.7 installed. I would like to install Python 3.5 as well. However, if I have both 2.7 and 3.5 installed, when I run pip, how do I get the direct the package to be installed to the desired Python version?

推荐答案

你将不得不使用 pip 的绝对路径.

You will have to use the absolute path of pip.

例如:如果我将 python 3 安装到 C:\python35,我会使用:<代码>C:\>python35\Scripts\pip.exe 安装包名

E.g: if I installed python 3 to C:\python35, I would use: C:\> python35\Scripts\pip.exe install packagename

或者,如果您使用的是 linux,请使用 pip3 install packagename

Or if you're on linux, use pip3 install packagename

如果您不指定完整路径,它将使用path 中的任何pip.

If you don't specify a full path, it will use whichever pip is in your path.

这篇关于在安装了 python 2.7 和 3.5 的 Windows 上使用 pip的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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