python - 在Windows上安装多个Python版本

标签 python windows batch-file

我分别将 python 3.4 和 python 3.5 安装到 C:\Python34C:\Python35 。 我创建了两个引用这些可执行文件的 bat 文件,即 python.batpython35.bat 并将它们添加到我的 PATH 中。这样我就可以得到

C:\>python -V 
Python 3.4.3

C:\>python35 -V
Python 3.5.1

C:\>pip

这对我来说效果很好,除非我想调用 PIP ,因为它实际上位于 PythonXX\Scripts\ 文件夹内。

有没有一种简单的方法可以从 cmd 调用 pip 和其他脚本, 无需每次输入 C:\>Python34\Scripts\pipC:\>Python35\Scripts\pip

(注意:pip 不是我想从 Scripts 文件夹运行的唯一文件。我可以为 Scripts 目录指定别名吗?)

最佳答案

您可以创建symbolic links :

for %A in (c:\Python34\Scripts\*.exe) do mklink C:\Windows\System32\%~nA34.exe %A

然后用pip34调用pip。 对其他 python 版本执行相同的操作。

关于python - 在Windows上安装多个Python版本,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/34877270/

相关文章:

file - 使用 7zip 按年份归档文件

QtWebKit 中的 JavaScript 和异步方法

windows - 如何在 Windows 上开始 Qt 开发,但目标是 Maemo 5?

Windows 事件日志 : How fast are operations with it?

batch-file - windows bat 文件错误

windows - 批量删除小于一定大小的文件

python - Google 应用引擎上的 Django : "Instance names cannot contain the ' :' character."

python - 与 Google App Engine 和 Flask 一起使用时 Angular 路由不起作用

python - 遵循 pygame 教程时,我遇到了未定义名称的问题

带有 Twitter 的 Ruby SSL 因 Windows 7 上的证书 OpenSSL 问题而失败