Powershell Python:更改使用的版本 [英] Powershell Python: Change version used

查看:107
本文介绍了Powershell Python:更改使用的版本的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用的是 windows xp.

I'm using windows xp.

我正在尝试在 powershell 中使用 Python.在我的电脑上,我安装了 Python 3.3 和 2.7.我正在尝试运行 2.7,但是每当我在 powershell 中键入python"时,它都会打开 3.3.

I'm trying to use Python in powershell. On my computer I have both Python 3.3 and 2.7 installed. I'm trying to run 2.7 but whenever I type "python" into powershell it opens 3.3.

如何选择要运行的 Python 版本?

How do I select the version of Python to run?

推荐答案

在 powershell 中,输入以下内容:

In powershell, enter the following:

$Env:PY_PYTHON = 2

然后尝试使用命令py".它应该启动 Python 2.7.如果你想再次运行 Python 3.3,py -3"就可以了.

Then try using the command "py". It should start up Python 2.7. If you ever want to run Python 3.3 again, "py -3" will do the trick.

这篇关于Powershell Python:更改使用的版本的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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