我刚开始学习用Python编写代码(也是第一次使用Powershell),所以我认为我的问题非常基础。当我尝试在PS中运行任何Python脚本时,我得到如下所示的错误。我在网上找到的主要建议是(1)确保我已经将执行策略设置为无限制,(2)编辑我的路径以包括"c:\Python27;c:\Python27\Scripts"我已经做了这两件事。我还应该尝试什么?
PS C:\windows\system32> python
python.exe : Python 2.7.6 (default, Nov 10 2013, 19:24:18) [MSC v.1500 32 bit (Intel)] on win32
At line:1 char:7
+ python <<<<
+ CategoryInfo : NotSpecified: (Python 2.7.6 (d...ntel)] on win32:String) [], RemoteException
+ FullyQualifiedErrorId : NativeCommandError
Type "help", "copyright", "credits" or "license" for more information.发布于 2018-02-04 04:52:23
这可能是由于64位/32位不匹配造成的。假设您使用的是64位的"Powershell“或"Powershell ISE”,请尝试在"Powershell (x86)“中运行python命令。
https://stackoverflow.com/questions/22390395
复制相似问题