virtualenv fails with Python 3.5 on Windows

Created on 15 Sep 2015  ·  16Comments  ·  Source: pypa/virtualenv

  1. Install Python 3.5 using the official Windows installer
  2. Get a shell
  3. python -m ensurepip (because the installer didn't install pip for me for some reason)
  4. python -m pip install virtualenv (gets me version 13.1.2)
  5. python -m virtualenv env

I expect: a virtualenv in ./env

I get: a GUI error dialog saying "The program can't start because VCRUNTIME140.dll is missing from your computer."

Apparently virtualenv needs to copy vcruntime140.dll into the new virtualenv for Python 3.5 to work on Windows.

Originally filed at http://bugs.python.org/issue25119

Most helpful comment

Similarily, it doesn't copy python3.dll which means some extension modules (like PyQt5) will fail with ImportError: DLL load failed: The specified module could not be found.

All 16 comments

@zooba do you have any advice on how best virtualenv should be proceeding here? Copying a dll to every 3.5 virtualenv?

Yeah, that's going to be necessary.

On Windows, I'd suggest copying every vcruntime*.dll file from sys.prefix and join(sys.prefix, 'DLLs'). At some point we will move vcruntime140.dll into DLLs for back-compat with older extension modules, but no telling when that will be (I'm not yet convinced it will have to be in a major release).

Do you also get this error with https://pypi.python.org/pypi/virtualenv-rewrite ?

No, virtualenv-rewrite works fine with Python 3.5. (I've tested virtualenv-rewrite 14.1.0 a while ago, it still works fine on my Jenkins.)

I'm having the same issue on Windows and copying the dll is not enough as it has not really finished setting up the scripts.

I have python 2.7 and 3.5 on the same windows (both installed for all users) and it fails with all the following commands.

> virtualenv --python="C:\Python35\python.exe" env

(with virtualenvwrapper) > mkvirtualenv --python="C:\Python35\python.exe" env

> C:\Python35\Scripts\virtualenv-3.4.exe  --python="C:\Python35\python.exe" env

confirm this bug with Python 3.5.1 under windows 10 with virtualenv v13.1.2 :(

Btw, I had to revert to 3.4 to get it to work.

I confirm this with Python 3.5.2 under Windows 10 with virtualenv 15.0.3

confirm this with Python 3.5.2 under Windows 8.1 with virtualenv 15.0.3

Confirm bug with Python 3.5.2 on Windows 7 with virtualenv 15.0.3

Ok guyz. I had the same problem. I installed "pywin32" from https://sourceforge.net/projects/pywin32/.
I didnt get the error after that. pywin32 has python extension for windows.
Install it for your version of python.
Make sure you get the correct version (matches Python version, 32bit/64bit, etc).
Hope it helps.

Thank you, Amytipple! BTW no need to download DLL files from untrusted random Internet sites, just copy the one from c:/Python3.5/ (or wherever you installed Python 3.5) into any directory on your %PATH%.

Similarily, it doesn't copy python3.dll which means some extension modules (like PyQt5) will fail with ImportError: DLL load failed: The specified module could not be found.

There is a simple workaround. Just update the path to include the specific Python version, e.g.:

set "PATH=C:\Program Files (x86)\Python36-32;%PATH%"

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Just add a comment if you want to keep it open. Thank you for your contributions.

Was this page helpful?
0 / 5 - 0 ratings