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

Issue #260 on hold
Florian Bruhin created an issue

With this tox.ini:

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

and a minimal setup.py:

from setuptools import setup
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\setup.py
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': '192.168.122.1 39354 22', 'PROGRAMW6432': 'C:\\Program Files', 'TEMP': 'C:\\Users\\florian\\AppData\\Local\\Temp', 'COMMONPROGRAMFILES': 'C:\\Program Files\\Common Files', 'ALLUSERSPROFILE': 'C:\\ProgramData', 'SSHWINGROU
P': 'EVERYONE', 'PROGRAMFILES(X86)': 'C:\\Program Files (x86)', 'SSH_CONNECTION': '192.168.122.1 39354 192.168.122.85 22', 'PROCESSOR_LEVEL': '6', 'PROCESSOR_ARCHITECTURE': 'AMD64', 'SYSTEMDRIVE': 'C:', 'PROCESSOR_IDENTIFIER':
 '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\
\cmd.exe', 'PATHEXT': '.COM;.EXE;.BAT;.CMD;.VBS;.VBE;.JS;.JSE;.WSF;.WSH;.MSC;.PY', 'FP_NO_HOST_CHECK': 'NO', 'PYTHONHASHSEED': '883', 'USERDOMAIN_ROAMINGPROFILE': 'qemu-win8'}

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.

Comments (5)

  1. Florian Bruhin reporter

    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!

  2. Log in to comment