我正在尝试在 powershell 中使用 python [英] I'm trying to use python in powershell

查看:45
本文介绍了我正在尝试在 powershell 中使用 python的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试遵循 Zed Shaw 的《以艰难的方式学习 Python》指南.我需要在 Powershell 中使用 python.我在 C:\Python27 中安装了 Python 2.7.3.每当我在 Powershell 中键入 python 时,都会收到一条错误消息,指出术语python"未被识别为 cmdlet、函数、脚本文件或可运行程序的名称.我还输入了: [Environment]::SetEnvironmentVariable("Path", "$env:Path;C:\Python27", "User")这是提供的建议解决方案,但在 Powershell 中输入 python 仍然没有任何作用.我可以输入start python",它会用python打开一个窗口,但我需要在Powershell中使用它.谢谢.

I'm trying to follow Zed Shaw's guide for Learning Python the Hard Way. I need to use python in Powershell. I have Python 2.7.3 installed in C:\Python27. Whenever I type python into Powershell, I get an error that says the term 'python' is not recognized as the name of a cmdlet, function, script file, or operable program. I also typed in this: [Environment]::SetEnvironmentVariable("Path", "$env:Path;C:\Python27", "User") That was a suggested solution provided, but typing python into Powershell still does nothing. I can type in "start python" and it opens up a window with python but I need it in Powershell. Thanks.

推荐答案

尝试这样设置路径:

 $env:path="$env:Path;C:\Python27"

这篇关于我正在尝试在 powershell 中使用 python的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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