我正在阅读 Zed Shaw 的 Python the Hard Way 一书的第一章,但我已经卡住了。我可以在命令 shell 中运行 python,但是当我尝试在 PowerShell 中运行它时,我得到了这个:
python : Python 3.7.3 (v3.7.3:ef4ec6ed12, Mar 25 2019, 21:26:53) [MSC v.1916 32 bit (Intel)] on win32
At line:1 char:1
+ python
+ ~~~~~~
+ CategoryInfo : NotSpecified: (Python 3.7.3 (v...ntel)] on win32:String) [], RemoteException
+ FullyQualifiedErrorId : NativeCommandError
任何指导表示赞赏。我现在将继续使用命令 shell,但很想弄清楚 PowerShell
最佳答案
您必须运行 Windows PowerShell,而不是 Windows PowerShell ISE。
ISE 是 PowerShell 的脚本编辑器,不运行 python。 Windows PowerShell(不是 ISE)允许您运行 python。
关于Powershell ISE 中出现 Python 错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/55602727/