Closed SWBennett06 closed 4 years ago
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.
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.
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)
Closed due to no response and reproduction.
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 ranpy 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.