Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

'failed to create process' after PIP install - Possible Python 3 Compatibility Issue? #24

Closed
SWBennett06 opened this issue Nov 24, 2016 · 4 comments

Comments

@SWBennett06
Copy link

Installed via PIP on two separate computers running Windows 10 with Python 3.5.2 and Python 3.5.0 and attempted httpstat google.com in the command line and received 'failed to create process'. Navigated directly in the command line to the default Python scripts folder and ran py httpstat-script.py google.com and received the following on both machines:
Traceback (most recent call last): File ".\httpstat-script.py", line 9, in <module> load_entry_point('httpstat==1.2.1', 'console_scripts', 'httpstat')() File "c:\users\%NAME%\appdata\local\programs\python\python35\lib\site-packages\httpstat.py", line 221, in main p = subprocess.Popen(cmd, stdout=subprocess.PIPE, stderr=subprocess.PIPE, env=cmd_env) File "c:\users\%NAME%\appdata\local\programs\python\python35\lib\subprocess.py", line 947, in __init__ restore_signals, start_new_session) File "c:\users\%NAME%\appdata\local\programs\python\python35\lib\subprocess.py", line 1224, in _execute_child startupinfo) FileNotFoundError: [WinError 2] The system cannot find the file specified

Ran repair on my Python installation and retried. Uninstalled and reinstalled Python (using elevated privileges) and retried. No positive effect.

An attempt on a third Win10 computer with both Python 3.5.1 and Python 2.7 installed worked without issue. Installed via PIP and httpstat google.com ran correctly. Running the script directly on that machine with either version of Python also works without issue.

@reorx
Copy link
Owner

reorx commented Nov 24, 2016

This seems like curl is not installed in the windows, can you make sure whether curl is installed or not in the first and second windows?

Since httpstat is just a wrapper around curl, it relies on it very deeply. But as curl may not installed on every windows (though it's available in almost every unix), it makes an obstacle to use httpstat on it. I suggest using the go version of httpstat which has windows binary execution included: https://github.com/davecheney/httpstat/releases , there's no installation or any programming environment needed, just download and run it would be OK.

@SWBennett06
Copy link
Author

Thanks for the quick response. Curl is definitely installed and works without issue. I was able to use the Node implementation off httpstat with no issue.

@reorx
Copy link
Owner

reorx commented Nov 25, 2016

I tried again on my windows vm, but could not reproduce your situation, can you try to run this script on your machines that encounter the problem? I want to exclude all the other factors only to take a look on how curl is executed.

test_curl.py:

#!/usr/bin/env python
# coding: utf-8

import sys
import subprocess


PY3 = sys.version_info >= (3,)

if PY3:
    xrange = range


def run_curl(curl_bin):
    print('run curl: {}'.format(curl_bin))
    cmd = [curl_bin, 'https://www.google.com']
    p = subprocess.Popen(cmd, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
    out, err = p.communicate()
    if PY3:
        out, err = out.decode(), err.decode()
    print('stdout and stderr: {}, {}'.format(out, err))


if __name__ == '__main__':
    curls = ['curl', 'curl.exe']

    for i in curls:
        run_curl(i)

@reorx
Copy link
Owner

reorx commented Oct 15, 2020

Closed due to no response and reproduction.

@reorx reorx closed this as completed Oct 15, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants