Powershell中的Python脚本:远程异常和本机命令错误
我刚开始学习用Python编程(也是第一次用Powershell),所以我觉得我的问题很基础。当我在Powershell中运行任何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.
1 个回答
11
这可能是因为你的系统有64位和32位不匹配的问题。试着在“Powershell (x86)”里运行python命令,假设你之前是在64位的“Powershell”或“Powershell ISE”中运行的。