Python Subprocess Windowserror Error 2
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
File "c:\python27\lib\subprocess.py", Line 958, In _execute_child Startupinfo)
About Us Learn more about Stack Overflow the company Business Learn more about windowserror: [error 2] the system cannot find the file specified pytesseract hiring developers or posting ads with us Stack Overflow Questions Jobs Documentation Tags Users Badges Ask Question x Dismiss Join
Python Filenotfounderror: [winerror 2] The System Cannot Find The File Specified
the Stack Overflow Community Stack Overflow is a community of 6.2 million programmers, just like you, helping each other. Join them; it only takes a minute: Sign up Problems using subprocess.call() in Python python the system cannot find the path specified 2.7.2 on Windows up vote 9 down vote favorite 3 I'm trying the following and its failing with an error. I've tried to run it from Python shell/from a script/ on the windows console by invoking python on console. Nothing seems to work. Always the same error. from subprocess import call >>>pat = "d:\info2.txt" >>> call(["type",pat]) >>>Traceback (most recent call last): File "", line 1, rpy2 windowserror: [error 2] the system cannot find the file specified in call(["type",pat]) File "C:\Python27\lib\subprocess.py", line 493, in call return Popen(*popenargs, **kwargs).wait() File "C:\Python27\lib\subprocess.py", line 679, in __init__ errread, errwrite) File "C:\Python27\lib\subprocess.py", line 893, in _execute_child startupinfo) WindowsError: [Error 2] The system cannot find the file specified does anyone know what is wrong here.!!??? even the simple call(["date"]] without any arguements also fails with the same error. I'm using : Python 2.72 32bit version on a windows 7 machine. python python-2.7 share|improve this question edited May 3 '13 at 18:08 LJNielsenDk 729725 asked Mar 2 '12 at 10:26 Vinayaka 2082620 1 what is call in your example? please include your imports? Assuming you mean the function from the subprocess package, I can't reproduce your error, since call(["data"]) works perfectly fine on my system. What are your python version, os, and stuff like that? –David Zwicker Mar 2 '12 at 10:41 1 Here are the details you asked for : Yes, call is the function in subprocess. I've made the necessary edits now above. hope the situation is clear now. –Vinayaka Mar 2 '12 at 10:49 @David Zwicker: The DOS command date exists on Windows, it displays or sets the date. –
here for a quick overview of the site Help Center Detailed answers to any questions you might have Meta Discuss the workings and
Subprocess.popen Windows
policies of this site About Us Learn more about Stack Overflow the python subprocess no such file or directory company Business Learn more about hiring developers or posting ads with us Stack Overflow Questions Jobs Documentation Tags
Returned Non-zero Exit Status 1
Users Badges Ask Question x Dismiss Join the Stack Overflow Community Stack Overflow is a community of 6.2 million programmers, just like you, helping each other. Join them; it only http://stackoverflow.com/questions/9531683/problems-using-subprocess-call-in-python-2-7-2-on-windows takes a minute: Sign up Cannot find the file specified when using subprocess.call('dir', shell=True) in Python up vote 12 down vote favorite 1 In a 64-bit system with 32 bit python 2.7 installed I am trying to do the following: import subprocess p = subprocess.call('dir', shell=True) print p But this gives me: Traceback (most recent call last): File "test.py", line 2, http://stackoverflow.com/questions/20330385/cannot-find-the-file-specified-when-using-subprocess-calldir-shell-true-in in p = subprocess.call('dir', shell=True) File "C:\Python27\lib\subprocess.py", line 522, in call return Popen(*popenargs, **kwargs).wait() File "C:\Python27\lib\subprocess.py", line 709, in __init__ errread, errwrite) File "C:\Python27\lib\subprocess.py", line 957, in _execute_child startupinfo) WindowsError: [Error 2] The system cannot find the file specified If I in the terminal do... dir ...it of course prints the present folder content. I have tried to change the shell parameter to shell=False. Edit: Actually I cannot call any executable on the path with subprocess.call(). The statement p = subprocess.call('dir', shell=True) works fine on another machine and I think that it is related. If I do subprocess.call('PATH', shell=True) then I get Traceback (most recent call last): File "test.py", line 4, in subprocess.call('PATH', shell=True) File "C:\Python27\lib\subprocess.py", line 522, in call return Popen(*popenargs, **kwargs).wait() File "C:\Python27\lib\subprocess.py", line 709, in __init__ errread, errwrite) File "C:\Python27\lib\subprocess.py", line 957, in _execute_child startupinfo) WindowsError: [Error 2] The system cannot find the file specified If I do: import os print os.curdir then I get . All of the above is executed in the terminal started in Administrator mode. python shell python-2.7 path subprocess share|impr
Sign in Pricing Blog Support Search GitHub https://github.com/kennethreitz/legit/issues/148 This repository Watch 73 Star 4,163 Fork 173 kennethreitz/legit Code Issues 45 Pull requests 3 Projects 0 Wiki Pulse Graphs https://discuss.atom.io/t/cannot-build-electron-on-windows-windowserror-error-2-the-system-cannot-find-the-file-specified/19703 New issue "WindowsError: [Error 2] The system cannot find the file specified" #148 Open the-shank opened this Issue Jun 11, 2014 error 2 · 2 comments Projects None yet Labels None yet Milestone No milestone Assignees No one assigned 2 participants the-shank commented Jun 11, 2014 I am getting the above error whenever I try running any legit command. Here is the ouput the system cannot from the terminal. C:\Users\6008321\git\requisition-tool>legit sync Traceback (most recent call last): File "C:\Python27\Scripts\legit-script.py", line 9, in load_entry_point('legit==0.1.1', 'console_scripts', 'legit')() File "C:\Python27\lib\site-packages\legit\cli.py", line 45, in main cmd_map.get(arg).__call__(args) File "C:\Python27\lib\site-packages\legit\cli.py", line 155, in cmd_sync if repo.is_dirty(): File "C:\Python27\lib\site-packages\git\repo\base.py", line 502, in is_dirty len(self.git.diff('HEAD', '--cached', *default_args)): File "C:\Python27\lib\site-packages\git\cmd.py", line 227, in return lambda *args, **kwargs: self._call_process(name, *args, **kwargs) File "C:\Python27\lib\site-packages\git\cmd.py", line 456, in _call_process return self.execute(call, **_kwargs) File "C:\Python27\lib\site-packages\git\cmd.py", line 335, in execute **subprocess_kwargs File "C:\Python27\lib\subprocess.py", line 711, in __init__ errread, errwrite) File "C:\Python27\lib\subprocess.py", line 948, in _execute_child startupinfo) WindowsError: [Error 2] The system cannot find the file specified I am on Windows 7. the-shank commented Jun 12, 2014 I dug into this further and from this post on StackOverflow, I found the solution. The problem
I have installed git, python2.7, VS 2013 Ultimate, and I'm using windows 8.1. Some clue on what I should do? Thanks. C:\Users\tboga_000\Copy\electron-master>python .\script\build.py Traceback (most recent call last): File ".\script\build.py", line 45, in sys.exit(main()) File ".\script\build.py", line 25, in main ret = subprocess.call([ninja, '-C', build_path, args.target]) File "C:\Python27\lib\subprocess.py", line 522, in call return Popen(*popenargs, **kwargs).wait() File "C:\Python27\lib\subprocess.py", line 710, in __init__ errread, errwrite) File "C:\Python27\lib\subprocess.py", line 958, in _execute_child startupinfo) WindowsError: [Error 2] The system cannot find the file specified tbogard 2015-08-08 01:43:11 UTC #2 Update : I put Ninja on the path of python and aparently the script can read it. still I got a similar error: Traceback (most recent call last): File "script\build.py", line 45, in sys.exit(main()) File "script\build.py", line 25, in main ret = subprocess.call([ninja, '-C', build_path, args.target]) File "C:\Python27\lib\subprocess.py", line 486, in call return Popen(*popenargs, **kwargs).wait() File "C:\Python27\lib\subprocess.py", line 672, in __init__ errread, errwrite) File "C:\Python27\lib\subprocess.py", line 882, in _execute_child startupinfo) WindowsError: [Error 2] The system cannot find the file specified Please HELP!!!! HSGorman 2016-03-14 10:35:55 UTC #3 Had the same issue. Couldn't get this running in the windows command prompt or powershell. I have git bash installed so tried it from there using / instead of \. At the moment it's compiling away. Will let you know if it completes. HSGorman 2016-03-14 11:01:53 UTC #4 Update. Got bootstrap.py to compile on the second attempt (not sure what failed first go but it was pulling in updates and unzipping them). Now build.py is building, will keep you posted. HSGorman 2016-03-14 11:41:01 UTC #5 Ok. All built at this stage. Switch to the git bash and try again. Home Categories FAQ/Guidelines Terms of Service Privacy Policy Powered by Discourse, be