0
votes

I am just trying to code print("Hello World") a basic code and the editor is giving me the error

[WinError 2] The system cannot find the file specified [cmd: ['python3', '-u', 'C:\Users\DELL\Desktop\python_work\hello_world.py']] [dir: C:\Users\DELL\Desktop\python_work] [path: C:\Program Files (x86)\Common Files\Intel\Shared Libraries\redist\intel64\compiler;C:\Program Files\Common Files\Microsoft Shared\Windows Live;C:\Program Files (x86)\Common Files\Microsoft Shared\Windows Live;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Program Files (x86)\Windows Live\Shared;C:\Users\DELL\AppData\Local\Programs\Python\Python38\Scripts] [Finished]

Now i have done to create a new build by Tools>Build System>New Build System and in that I changed to this code

{
    //"shell_cmd": "make"
     "cmd": ["C:\\Users\\DELL\\AppData\\Local\\Programs\\Python\\Python38", "-u", "$file"],
    "file_regex": "^[ ]*File \"(...*?)\", line ([0-9]*)",
    "selector": "source.python"
}

and saved it as file in sublime folder but still showing the same error.I am not understanding what is going wrong.

3
You don't mention it specifically in your question, so just in case note that in addition to saving a new build file you also have to choose it from the list of build systems in the menu or when Sublime asks you to choose the build to use. Apart from that I would as suggested in the answer below double check that the full path to the python interpreter that you're using is correct.OdatNurd

3 Answers

0
votes

Make sure to check that the file is located exactly where the program thinks it is and that the filename is the same.

"[WinError 2] The system cannot find the file specified" might help.

0
votes

I would recommend this:

  1. Open cmd and run python using py or python or python3. Search which works. Copy this. I'll call X 2.Changing in the line to "cmd": ["X", "-u", "$file"]
  2. Save as a new build system
  3. Build your code with the build system
-1
votes

WinError 2] The system cannot find the file specified [cmd: ['H:/python/py3.7.9/python.exe', '-u', 'C:\Users\Ashwin Kumar\AppData\Roaming\Sublime Text 3\Packages/Kivy Language/preview/kv.preview.py', 'H:\python\development\kivy_venv\Lib\site-packages\ftapp.py', 'H:\python\development\kivy_venv\first_app']] [dir: H:\python\development\kivy_venv\Lib\site-packages] [path: C:\Program Files (x86)\Common Files\Oracle\Java\javapath;F:\oracle\product\10.2.0\db_1\bin;C:\ProgramData\Oracle\Java\javapath;C:\Program Files (x86)\Lenovo\FusionEngine;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\WINDOWS\System32\WindowsPowerShell\v1.0;C:\Program Files (x86)\ATI Technologies\ATI.ACE\Core-Static;C:\Program Files (x86)\Microsoft SQL Server\100\Tools\Binn;C:\Program Files\Microsoft SQL Server\100\Tools\Binn;C:\Program Files\Microsoft SQL Server\100\DTS\Binn;C:\Program Files (x86)\Microsoft SDKs\TypeScript\1.0;C:\Program Files\Microsoft SQL Server\Client SDK\ODBC\110\Tools\Binn;C:\Program Files (x86)\Microsoft SQL Server\120\Tools\Binn;C:\Program Files\Microsoft SQL Server\120\Tools\Binn;C:\Program Files\Microsoft SQL Server\120\DTS\Binn;C:\Program Files\Windows Fabric\bin\Fabric\Fabric.Code;C:\WINDOWS\System32\OpenSSH;C:\Program Files\Microsoft SQL Server\130\Tools\Binn;C:\Program Files\Microsoft SQL Server\Client SDK\ODBC\170\Tools\Binn;C:\Program Files\dotnet;C:\ProgramData\chocolatey\bin;C:\Program Files\Git\cmd;C:\py3.7.9;C:\py3.7.9\Scripts;C:\py3.7.9\Lib\site-packages;C:\py3.7.9\Lib\site-packages\kivy;C:\python_3.8\Scripts;C:\python_3.8;C:\Users\Ashwin Kumar\AppData\Local\Microsoft\WindowsApps;C:\Users\Ashwin Kumar\AppData\Local\atom\bin;H:\2020\py_learning\PyCharm Community Edition 2019.3.1\bin;;C:\Users\Ashwin Kumar\AppData\Local\Microsoft\WindowsApps;] [Finished]

if you get above kind of problem,just check using below steps.

for dependency package installation use below link.

https://kivy.org/doc/stable/installation/installation-windows.html#alternate-win

  1. Ctrl+Shift+p ---> to go package control windows ---->type install package , then next coming entry type package name. i.e kivy
  2. Type kivy in the text entry
  3. if package installed do step 1. istead of install package type view files, hit entre, type kivy
  4. edit the file of the path C:\Users\user-name\AppData\Roaming\Sublime Text 3\Packages\Kivy Language\Kivy.sublime-build as below.

{ "cmd": ["python.exe", "-u", "$packages/Kivy Language/preview/kv.preview.py", "$file", "$folder"], "file_regex": "^[ ]File "(...?)", line ([0-9]*)", "selector": "source.kv", }

  1. select Build System as kivy , ie... Tools-->Build System-->kivy

6.run the code (ctrl+B)

Edits are welcome!.