2017-04-16 219 views
0

如果我使用两个Python版本,设置路径变量并稍后使用 pip install(包名称)..哪个pip将被激活。 两个版本都有内置的点子。Python pip兼容性

荫一个Python beginner..please帮助的Python

回答

0

后来的版本配备了Python Launcher。它已经在路径中并允许选择运行哪个Python。从路径删除python并使用启动,而不是:

py -3 -m pip <options> # Run latest Python 3 found on the system with its pip. 
py -2 -m pip <options> # Use latest Python 2 instead. 

启动程序具有更多的选择。请参阅提供的链接。您可能需要重新安装最近的Python 3,以确保已安装启动程序并注册了Python扩展。

+0

这是仅适用于Windows,但还是很方便... – Felix

1

如果您使用的是pip那么Python-2.7的点会触发,对于Python-3.x您必须使用pip3

即对Python的2.7

pip install <package_name> 

对Python的3.x的

pip3 install <package_name>