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

Fatal Python error when running 32bit Python via tox on Windows #260

pytoxbot opened this Issue Sep 17, 2016 · 2 comments


None yet
1 participant

pytoxbot commented Sep 17, 2016

With this tox.ini:

commands = {envpython} -c 'print("Hello World")'
basepython = C:\Python34_x32\python.exe

and a minimal

from setuptools import setup

I get this when running it on Windows:

C:\Users\florian\proj\qutebrowser\test>tox -e py34
GLOB sdist-make: C:\Users\florian\proj\qutebrowser\test\
py34 create: C:\Users\florian\proj\qutebrowser\test\.tox\py34
ERROR: invocation failed (exit code 3), logfile: C:\Users\florian\proj\qutebrowser\test\.tox\py34\log\py34-0.log
ERROR: actionid: py34
msg: getenv
cmdargs: ['C:\\Python34\\python.exe', '-m', 'virtualenv', '--python', 'C:\\Python34_x32\\python.exe', 'py34']
env: {'USERNAME': 'florian', 'SSHSESSIONID': '1003', 'PROGRAMFILES': 'C:\\Program Files', 'SYSTEMROOT': 'C:\\Windows', 'USERDOMAIN': 'qemu-win8', 'COMPUTERNAME': 'QEMU-WIN8', 'PROCESSOR_REVISION': '1a03', 'PYTHON': 'C:\\Python
34', 'PUBLIC': 'C:\\Users\\Public', 'PROMPT': '$P$G', 'PSMODULEPATH': 'C:\\Windows\\system32\\WindowsPowerShell\\v1.0\\Modules\\', 'VIM_EXE_DIR': 'C:\\Program Files (x86)\\Vim\\vim74', 'LOGONSERVER': '\\\\QEMU-WIN8', 'SSH_CLIE
NT': ' 39354 22', 'PROGRAMW6432': 'C:\\Program Files', 'TEMP': 'C:\\Users\\florian\\AppData\\Local\\Temp', 'COMMONPROGRAMFILES': 'C:\\Program Files\\Common Files', 'ALLUSERSPROFILE': 'C:\\ProgramData', 'SSHWINGROU
 'Intel64 Family 6 Model 26 Stepping 3, GenuineIntel', 'TMP': 'C:\\Users\\florian\\AppData\\Local\\Temp', 'HOMEDRIVE': 'C:', 'OS': 'Windows_NT', 'HOME': 'C:\\Users\\florian', 'LOCALAPPDATA': 'C:\\Users\\florian\\AppData\\Local
', 'HOMEPATH': '\\Users\\florian', 'COMMONPROGRAMW6432': 'C:\\Program Files\\Common Files', 'VIRTUAL_ENV': 'C:\\Users\\florian\\proj\\qutebrowser\\test\\.tox\\py34', 'SSHWINUSERDOMAIN': 'qemu-win8', 'NUMBER_OF_PROCESSORS': '1'
, 'USERPROFILE': 'C:\\Users\\florian', 'PROGRAMDATA': 'C:\\ProgramData', 'WINDIR': 'C:\\Windows', 'PATH': 'C:\\Users\\florian\\proj\\qutebrowser\\test\\.tox\\py34\\Scripts;C:\\Python34\\Lib\\site-packages\\PyQt5;C:\\Python34_x
32\\Lib\\site-packages\\PyQt5;C:\\asciidoc;C:\\Python34\\;C:\\Python34\\Scripts;C:\\Windows\\system32;C:\\Windows;C:\\Windows\\System32\\Wbem;C:\\Windows\\System32\\WindowsPowerShell\\v1.0\\;C:\\Program Files (x86)\\Git\\cmd;C
:\\asciidoc-8.6.9', 'APPDATA': 'C:\\Users\\florian\\AppData\\Roaming', 'WINSSHDGROUP': 'EVERYONE', 'COMMONPROGRAMFILES(X86)': 'C:\\Program Files (x86)\\Common Files', 'SSHWINUSER': 'florian', 'COMSPEC': 'C:\\Windows\\system32\

Fatal Python error: Failed to initialize Windows random API (CryptoGen)
Running virtualenv with interpreter C:\Python34_x32\python.exe

ERROR: InvocationError: C:\Python34\python.exe -m virtualenv --python C:\Python34_x32\python.exe py34 (see C:\Users\florian\proj\qutebrowser\test\.tox\py34\log\py34-0.log)

Searching for the error it seems this happens when SYSTEMROOT is not set.

Even though SYSTEMROOT is printed in the environment above, I tried to add passenv = * and setenv = SYSTEMROOT=C:\Windows without any success.

When I run that Python install by hand, it works fine. When I use a 64bit install instead of the 32bit one on the same machine, it's fine as well.

I also tried downgrading to 1.9.2 and it happens there as well, so it doesn't seem to be a recent passenv change.


This comment has been minimized.

pytoxbot commented Sep 17, 2016

Original comment by @The-Compiler

After some more investigating this seems to be some weird bug in Python or Windows.

I opened a Python issue and a virtualenv issue (for a possible workaround) now.

@pytoxbot pytoxbot closed this Sep 17, 2016


This comment has been minimized.

pytoxbot commented Sep 17, 2016

Original comment by @The-Compiler

Oh the joy of getting the important ideas only after opening an issue...

Running C:\Python34\python.exe -m virtualenv --python=C:\Python34_x32\python.exe venv gives me the same error, so I guess this is a virtualenv bug - I'll open a bug there.

Sorry for the noise!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment