我有一个名为test.py
的文件,内容如下:
print ("Welcome")
在Sumblime Text中运行此结果会在输出中出现以下错误:
[WinError 2] The system cannot find the file specified
[cmd: ['C:\\Users\\Mark\\AppData\\Local\\Programs\\Python\\Python35-32\\Python.exe', '-u', 'C:\\Users\\Mark Kaganovich\\Desktop\\test.py']]
[dir: C:\Users\Mark Kaganovich\Desktop]
[path: C:\Program Files (x86)\Common Files\Oracle\Java\javapath;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Program Files\Java\jre1.8.0_171\bin;C:\Users\Mark Kaganovich\AppData\Local\Programs\Python\Python37-32;C:\Users\Mark Kaganovich\AppData\Local\Programs\Python\Python37-32\python.exe;C:\Users\Mark Kaganovich\AppData\Local\Programs\Python\Python37-32\Scripts\;C:\Users\Mark Kaganovich\AppData\Local\Programs\Python\Python37-32\;C:\Users\Mark Kaganovich\AppData\Local\Microsoft\WindowsApps;]
[Finished]
答案 0 :(得分:0)
您在environment variables
中的python路径似乎与您运行的python不同。
您的python
路径是:
C:\ Users \ Mark Kaganovich \ AppData \ Local \ Programs \ Python \ Python37-32
但是您的命令正在搜索:
C:\ Users \ Mark Kaganovich \ AppData \ Local \ Programs \ Python \ Python35-32
如果确定您拥有Python35-32
,则只需将其添加到environment variables
。
以下是向python
添加environment variables
路径的说明: