Closed avanbecelaere-frb closed 3 years ago
Same for me, seems to be a Windows specific problem.
I found a fix for it by modifying "awslocal" python script in Python/Scripts folder. Just add a line that will initialize "env" variable in function "run":
def run(cmd, env={}):
def output_reader(pipe, out):
out_binary = os.fdopen(out.fileno(), 'wb')
with pipe:
for line in iter(pipe.readline, b''):
out_binary.write(line)
out_binary.flush()
env=os.environ
process = subprocess.Popen(
cmd, env=env,
stderr=subprocess.PIPE, stdout=subprocess.PIPE, stdin=subprocess.PIPE)
Thread(target=output_reader, args=[process.stdout, sys.stdout]).start()
Thread(target=output_reader, args=[process.stderr, sys.stderr]).start()
process.wait()
sys.exit(process.returncode)
Here is the explanation of the problem: https://www.scivision.dev/python-calling-python-subprocess/
The above fix worked for me on Win10. FWIW the file I edited is located: C:\Python38\Scripts\awslocal
@GrzesioG only added the line env = os.environ
to awslocal
. Their fix also worked for me on Windows 10.
Unlike @donaldgray, the file I edited was in C:\Users\username\AppData\Local\Programs\Python\Python37\Scripts\awslocal
. Obviously, that's dependent on the Python installation location.
This is still a problem for Windows users installing awslocal. Can that workaround be merged into the codebase.
Hi @SingingBush @UrosOgrizovic @donaldgray @GrzesioG @aeisele @avanbecelaere-frb . Quick update - looks like a missing SYSTEMROOT
env variable could be the culprit here under Windows. We have pushed a small fix in 254273bce710eb69f50dcefe09e168f3d61bda60 that should (hopefully) get this resolved. Can you please try upgrading to the latest version and give it another try? Please keep us posted how it goes. Thanks!
pip install --upgrade 'awscli-local>=0.18'
@whummer, v0.18 works for me. Thank you!
aws-cli/2.1.35 Python/3.8.8 Windows/10 exe/AMD64 prompt/off
Fatal Python error: _Py_HashRandomization_Init: failed to get random numbers to initialize Python Python runtime state: preinitialized