Python Subprocess Windows Error 2
Contents |
here for a quick overview of the site Help Center Detailed answers to any questions you might have Meta Discuss the workings and policies of this site About Us Learn more about Stack Overflow the company file "c:\python27\lib\subprocess.py", line 958, in _execute_child startupinfo) Business Learn more about hiring developers or posting ads with us Stack Overflow Questions Jobs windowserror: [error 2] the system cannot find the file specified pytesseract Documentation Tags Users Badges Ask Question x Dismiss Join the Stack Overflow Community Stack Overflow is a community of 6.2 million programmers, python filenotfounderror: [winerror 2] the system cannot find the file specified just like you, helping each other. Join them; it only takes a minute: Sign up Windows can't find the file on subprocess.call() up vote 42 down vote favorite 10 I am getting the following error: WindowsError: [Error
Python The System Cannot Find The Path Specified
2] The system cannot find the file specified My code is: subprocess.call(["<
here for a quick overview of the site Help Center Detailed answers to any questions you might have Meta Discuss the workings and policies of this site About Us Learn more about Stack Overflow the company Business error 2 the system cannot find the file specified windows 7 Learn more about hiring developers or posting ads with us Stack Overflow Questions Jobs Documentation
Subprocess.popen Windows
Tags Users Badges Ask Question x Dismiss Join the Stack Overflow Community Stack Overflow is a community of 6.2 million programmers, just
Python Subprocess No Such File Or Directory
like you, helping each other. Join them; it only takes a minute: Sign up “WindowsError: [Error 2] The system cannot find the file specified” is not resolving up vote 2 down vote favorite I have created exe file http://stackoverflow.com/questions/3022013/windows-cant-find-the-file-on-subprocess-call of my python project by py2exe which have number of files. when i run this exe file in my system. it works fine but if i put it in another system then it opens login form, then after it doesn't go to next window which i have written in 2nd python file. it gives me below error in log file. Traceback (most recent call last): File "login.py", line 246, in DataReader File "subprocess.pyo", line 711, http://stackoverflow.com/questions/18757127/windowserror-error-2-the-system-cannot-find-the-file-specified-is-not-resol in __init__ File "subprocess.pyo", line 948, in _execute_child WindowsError: [Error 2] The system cannot find the file specified I know that it is duplicate question but I have tried many solution of stackoverflow but i didn't resolve this issue. Somebody help me for resolving this issue. And After login successfully it will go to start.py file by this code, But it is not going and giving above error. subprocess.call(["python", "./start.py"]) Thanks in advance python gtk pygtk share|improve this question asked Sep 12 '13 at 6:41 Ashish Jain 4641314 If the file is in the same directory, try removing the ./ part. –Bibhas Sep 12 '13 at 6:46 No it is giving same error after removing it and all the file in same directory –Ashish Jain Sep 12 '13 at 6:52 add a comment| 1 Answer 1 active oldest votes up vote 2 down vote accepted There are at least two problems here. First, you can't just use python as the executable. On your system, you've got python on the %PATH%, and it's the right Python version, with all the modules you depend on, etc. But you can't rely on that for all of your users. If you could, you wouldn't bother with py2exe in the first place. And obviously, on the other machine you're testing on, there's just not
User List Committer List Help Tracker Documentation Tracker Development Report Tracker Problem Issue17023 classification Title: Subprocess does not find executable on Windows if it is PATH with quotes Type: behavior Stage: https://bugs.python.org/issue17023 resolved Components: Library (Lib), Windows Versions: Python 3.5, Python 3.4, Python 2.7 process Status: closed Resolution: wont fix Dependencies: Superseder: Assigned To: tim.golden Nosy List: BreamoreBoy, Eli_B, pekka.klarck, steve.dower, tim.golden, zach.ware Priority: normal Keywords: Created on 2013-01-24 13:09 by pekka.klarck, last changed 2015-02-08 12:53 by tim.golden. This issue is now closed. Messages (3) msg180520 - (view) Author: Pekka Klärck (pekka.klarck) Date: 2013-01-24 error 2 13:09 If you add a directory into PATH on Windows so that the directory is in quotes, subprocess does not find executables in it. They are found by the operating system, though, at least when run on the command prompt. To reproduce: C:\>python --version Python 2.7.3 C:\>type test\script.bat @echo off echo hello C:\>set ORIG=%PATH% C:\>set PATH=%ORIG%;test C:\>script.bat hello C:\>python -c "from subprocess import the system cannot call; call('script.bat')" hello C:\>set PATH=%ORIG%;"test" C:\>script.bat hello C:\>python -c "from subprocess import call; call('script.bat')" Traceback (most recent call last): File "