Skip to content

virtualenv 1.11.6 not working with MSYS2 #650

Closed
@pe224

Description

@pe224

I'm using the latest version of MSYS2 with Python 2.7.8 as the only system-wide Python.
Pip installed virtualenv 1.11.6 without problems.
Executing virtualenv myenv results in

Traceback (most recent call last):
  File "C:\msys64\home\eib/myvenv/lib/python2.7/site.py", line 703, in <module>
    main()
  File "C:\msys64\home\eib/myvenv/lib/python2.7/site.py", line 692, in main
    aliasmbcs()
  File "C:\msys64\home\eib/myvenv/lib/python2.7/site.py", line 515, in aliasmbcs
    import locale, codecs
  File "C:/msys64/home/eib/myvenv/lib/python2.7/locale.py", line 19, in <module>
    import functools
ImportError: No module named functools
New python executable in myvenv/Scripts/python.exe
ERROR: The executable myvenv/Scripts/python.exe is not functioning
ERROR: It thinks sys.prefix is u'c:\\msys64\\home\\eib' (should be u'c:\\msys64\\home\\eib\\myvenv')
ERROR: virtualenv is not compatible with this system or executable
Note: some Windows users have reported this error when they installed Python for "Only this user" or have multiple versions of Python installed. Copying the appropriate PythonXX.dll to the virtualenv Scripts/ directory may fix this problem.

Supplying additional arguments like an explicit --python didn't change anything.
Now there seem to be two problems:
First, the virtualenv is not created completely. Parts of myenv/lib are missing and there are no activation scripts.
Second, there is only a non-functioning python in myenv/Scripts/python.exe

Since there is no Python dll, I tried copying around libpython2.7.dll.a and libpython2.7.a, but to no avail. What made the myenv/Scripts/python.exe to work was to symlink the working Python lib/python2.7 to myvenv/lib/python2.7, then it could find the standard library.

Why does the virtualenv creation process stop in the middle? It looks like everything could be brought to work. Also, it seems that whole include/lib folders are copied, although MSYS2 is configured to do native windows symlinks with "ln -s". On my mac, virtualenv creates correct symlinks.

Is it a path issue? $MSYS_HOME is correctly set to /c/msys64
What's going on? Thanks for any pointers.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions