【发布时间】:2019-09-03 05:53:45
【问题描述】:
我在 Windows 服务器(64 位)中使用 python,它是由另一个用户在他自己的目录中安装的 C:\user\userx\AppData\Local\Programs\Python\Python36
所有其他用户(不包括我)都能够在此服务器上运行 Python 文件。运行 Python 程序时出现以下错误:
C:\Users\user x\AppData\Local\Programs\Python\Python36>test.py
launcher build: 32bit
launcher executable: Console
File 'C:\Users\my user\AppData\Local\py.ini' non-existent
File 'C:\Windows\py.ini' non-existent
Called with command line: "C:\Users\user x\AppData\Local\Programs\Python\Python
36\test.py"
maybe_handle_shebang: read 12 bytes
maybe_handle_shebang: BOM not found, using UTF-8
locating Pythons in 64bit registry
locate_pythons_for_key: unable to open PythonCore key in HKCU
locate_pythons_for_key: unable to open PythonCore key in HKLM
locating Pythons in native registry
locate_pythons_for_key: unable to open PythonCore key in HKCU
locate_pythons_for_key: unable to open PythonCore key in HKLM
found no configured value for 'python'
search for default Python found no interpreter
Can't find a default Python.
我尝试在命令行中使用set pylaunch_debug=1 运行我的代码,它显示以下错误。
【问题讨论】:
-
需要设置Path变量
-
编辑您的系统环境变量并将“C:\user\userx\AppData\Local\Programs\Python\Python36”附加到它
-
我也已经设置了路径变量。
-
尝试在cmd中运行python解释器
-
在 cmd python test.py 中有效,但 test.py 无效。但我想解决它以便能够使用 IDE。
标签: python python-3.x python-3.6