[Tutor] Windows Linux Popen

Matthew Ngaha chigga101 at gmail.com
Thu Jun 27 14:10:23 CEST 2013


i have more than 1 issue all involving things in the title. 1st i use
windows vista and was following along the pytest tutorial. the 1st
issue is with windows and SubProcess.Popen(). Everytime i run the test
which includes this line:

p = subprocess.Popen(
                ['python3', 'echo_server.py'])

i get this error pytest error:
E         WindowsError: [Error 2] The system cannot find the file specified

..\..\..\lib\subprocess.py:856: WindowsError

I will include the full program at the end i just want to show my issues 1st.
I asked for help at irc #python and they told me to try these 2 lines:

subprocess.Popen(['python3', 'echo_server.py'])
and
subprocess.check_output(['python3', 'echo_server.py'])

i get the same subprocess windows error for both lines. Someone told
me the code was fine, and that windows supports Popen and that it
might be another issue on my system. Which leads to my 2nd problem.

I downloaded ubuntu on VM just to test this out. as i have never used
linux i wasnt sure where and how to install pytest. I did pip install
.. it worked. "IT INSTALLED" and i ran the code and pytest returned
with no errors but it ignored every test on the file so i tried again.
it then said pytest was not installed "HUH?" and that i should use:

sudo apt-get install <select-package>

maybe im typing it wrong but i haven't managed to be able to install
it, even though strangely it installed the 1st time as i explained? i
tried those 2 lines that were failing on windows just to see if
subprocess worked on linux.

subprocess.Popen(['python3', 'echo_server.py'])
and
subprocess.check_output(['python3', 'echo_server.py'])

and they both gave me the output of "python3". great it works on linux
but still i cant install pytest on linux. And as windows is my main
OS, the windows error is still my biggest concern.

The actual code to my program is split between 2 files which i will
indicate in comments when i paste it. I was also told the issue isnt
with the code, but feel free to inspect it just incase, especially if
you have windows. Here it is:

http://bpaste.net/show/LaZBOwDlzBRkoWg5mM5Q/


More information about the Tutor mailing list