Skip to content

virtualenv==20.0.34 not compatible with python on windows #12094

Open

Description

@drewgilliam

Actual Behavior

virtualenv v20.0.34 fails on windows with anaconda python. virtualenv v20.0.34 introduced a requirement that python have the file <PYTHON_DIR>/Lib/venv/scripts/nt/python.exe. Anaconda python packages do not have this file.

Traceback

FileNotFoundError: [Errno 2] No such file or directory: 'C:\\<redacted>\\python-3.7.9\\Lib\\venv\\scripts\\nt\\python.exe'

Related issue

#10822

Virtualenv PRs that introduced the issue

pypa/virtualenv#1976
pypa/virtualenv#1977

Virtualenv line throwing error

https://github.com/gaborbernat/virtualenv/blob/main/src/virtualenv/create/via_global_ref/builtin/cpython/cpython3.py#L71

Expected Behavior

anaconda python & virtualenv==20.0.34 should be compatible.

Steps to Reproduce

On windows, create a conda environment with python and virtualenv==20.0.34, then try to create a virtualenv

conda create -n foo python virtualenv==20.0.34
conda activate foo
virtualenv ./bar
Anaconda or Miniconda version:

64-bit Miniconda3
https://repo.anaconda.com/miniconda/Miniconda3-latest-Windows-x86_64.exe
1f4ff67f051c815b6008f144fdc4c3092af2805301d248b56281c36c1f4333e5

Operating System:

Windows 10 64-bit

conda info
Details
     active environment : None
       user config file : C:\Users\drew\.condarc
 populated config files :
          conda version : 4.8.3
    conda-build version : not installed
         python version : 3.8.2.final.0
       virtual packages :
       base environment : C:\Users\drew\AppData\Local\Temp\_MEI454682  (read only)
           channel URLs : https://repo.anaconda.com/pkgs/main/win-64
                          https://repo.anaconda.com/pkgs/main/noarch
                          https://repo.anaconda.com/pkgs/r/win-64
                          https://repo.anaconda.com/pkgs/r/noarch
                          https://repo.anaconda.com/pkgs/msys2/win-64
                          https://repo.anaconda.com/pkgs/msys2/noarch
          package cache : C:\Users\drew\AppData\Local\Temp\_MEI454682\pkgs
                          C:\Users\drew\.conda\pkgs
                          C:\Users\drew\AppData\Local\conda\conda\pkgs
       envs directories : C:\Users\drew\.conda\envs
                          C:\Users\drew\AppData\Local\Temp\_MEI454682\envs
                          C:\Users\drew\AppData\Local\conda\conda\envs
               platform : win-64
             user-agent : conda/4.8.3 requests/2.23.0 CPython/3.8.2 Windows/10 Windows/10.0.18362
          administrator : False
             netrc file : None
           offline mode : False

conda list --show-channel-urls
Details
# packages in environment at C:\<redacted>\python-3.7.9:
#
# Name                    Version                   Build  Channel
appdirs                   1.4.4                      py_0    defaults
brotlipy                  0.7.0           py37he774522_1000    defaults
ca-certificates           2020.10.14                    0    defaults
certifi                   2020.6.20                py37_0    defaults
cffi                      1.14.3           py37h7a1dbc1_0    defaults
chardet                   3.0.4                 py37_1003    defaults
cryptography              3.1.1            py37h7a1dbc1_0    defaults
distlib                   0.3.1                    py37_0    defaults
filelock                  3.0.12                     py_0    defaults
idna                      2.10                       py_0    defaults
importlib-metadata        2.0.0                      py_1    defaults
openssl                   1.1.1h               he774522_0    defaults
pip                       20.2.3                   py37_0    defaults
pycparser                 2.20                       py_2    defaults
pyopenssl                 19.1.0                     py_1    defaults
pysocks                   1.7.1                    py37_1    defaults
python                    3.7.9                h60c2a47_0    defaults
requests                  2.24.0                     py_0    defaults
setuptools                50.3.0           py37h9490d1a_1    defaults
six                       1.15.0                     py_0    defaults
sqlite                    3.33.0               h2a8f88b_0    defaults
urllib3                   1.25.10                    py_0    defaults
vc                        14.1                 h0510ff6_4    defaults
virtualenv                20.0.34                  py37_0    defaults
vs2015_runtime            14.16.27012          hf0eaf9b_3    defaults
wheel                     0.35.1                     py_0    defaults
win_inet_pton             1.1.0                    py37_0    defaults
wincertstore              0.2                      py37_0    defaults
zipp                      3.3.0                      py_0    defaults
zlib                      1.2.11               h62dcd97_4    defaults

Activity

  1. PhilReinhold commented on Oct 14, 2020

    @PhilReinhold

    I also ran into this, since it breaks pre-commit. I can confirm that downgrading to virtualenv=20.0.33 removes the issue.

  2. jphme commented on Oct 18, 2020

    @jphme

    ran into the same issue, see my post here:

    _Originally posted by @jpdus in #10822 (comment)

  3. drewgilliam commented on Oct 19, 2020

    @drewgilliam
    Author

    virtualenv issue to officially support conda due to this problem.
    pypa/virtualenv#1986

  4. gaborbernat commented on Oct 20, 2020

    @gaborbernat

    Does anyone know why conda does not follow CPython on the venv creation? Why is custom patched?

  5. whg517 commented on Nov 19, 2020

    @whg517

    Does anybody know what's going on with this question? I used 'Pipenv' in my development, which relies on 'Virtualenv', and now I can't use it properly in my new environment, which annoys me.

  6. bharath5673 commented on Jan 8, 2021

    @bharath5673

    I also ran into this, since it breaks pre-commit. I can confirm that downgrading to virtualenv=20.0.33 removes the issue.

    tysm... i was facing the same issue while installing ESP-IDF on windows 10... downgraing venv got fixd ))

  7. added a commit that references this issue on Oct 3, 2021
  8. dmyersturnbull commented on Jun 26, 2023

    @dmyersturnbull

    FYI: Starting tomorrow, Conda will be broken on Windows for every maintained version of Python. (This will hold true for any virtualenv released in the last 3 years.)

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions