virtualenv icon indicating copy to clipboard operation
virtualenv copied to clipboard

conda support - Windows 3.7+

Open gaborbernat opened this issue 4 years ago • 2 comments

We don't have official conda support, but things kinda worked. This is no longer the case post #1976. Seems conda copies the venv module into its environments, and it's a version without the redirector script on Python3.7+.

❯ lsd --tree C:\Users\traveler\miniconda3\envs\virtualenv\Lib\venv\
 venv
├──  __init__.py
├──  __main__.py
├──  __pycache__
│  ├──  __init__.cpython-38.pyc
│  └──  __main__.cpython-38.pyc
└──  scripts
   ├──  common
   │  ├──  activate
   │  └──  Activate.ps1
   ├──  nt
   │  ├──  activate.bat
   │  └──  deactivate.bat
   └──  posix
      ├──  activate.csh
      └──  activate.fish

The part that differs from the core CPython:

❯ lsd --tree C:\\Users\\traveler\\AppData\\Local\\Programs\\Python\\Python38\\lib\\venv
 venv
├──  __init__.py
...
   ├──  nt
   │  ├──  activate.bat
   │  ├──  deactivate.bat
   │  ├──  python.exe
   │  └──  pythonw.exe
...

So users fail with:

(virtualenv) PS C:\Users\traveler> virtualenv --clear venv
FileNotFoundError: [Errno 2] No such file or directory: 'c:\\users\\traveler\\miniconda3\\envs\\virtualenv\\Lib\\venv\\scripts\\nt\\python.exe'

We should run tests with conda too, and support it though. Then we should update https://virtualenv.pypa.io/en/latest/installation.html#python-and-os-compatibility

gaborbernat avatar Oct 17 '20 16:10 gaborbernat

Any updates on this?

FaustinCarter avatar May 17 '22 00:05 FaustinCarter

It looks like this is still happening.

I've pegged virtualenv==20.0.33 in the requirements for all of my projects, plus my template. Otherwise my conda users hit this issue when they try to install. Unfortunately this means they're missing nearly 2 years of virtualenv updates.

dmyersturnbull avatar Jul 29 '22 04:07 dmyersturnbull

Just a note to the devs: Starting tomorrow, Conda will be broken on Windows for every not-past-EOL Python for any virtualenv released in the last 3 years.

dmyersturnbull avatar Jun 26 '23 19:06 dmyersturnbull

This feature is tagged with a help wanted. Seems no conda user/developer wanted to actually contribute though. I don't use conda, so this is not worth for me. In light of this closing this.

gaborbernat avatar Jun 26 '23 23:06 gaborbernat

Note, you can try changing the creator from builtin to venv for conda, per https://virtualenv.pypa.io/en/latest/user_guide.html#creators; and that might work.

gaborbernat avatar Jun 26 '23 23:06 gaborbernat