virtualenv
virtualenv copied to clipboard
inconsistent home value in pyvenv.cfg between venv and virtualenv
Issue
the home
value in pyvenv.cfg
is inconsistent when generated by venv
and virtualenv
:
$ python3.10 -m venv venv
$ grep home venv/pyvenv.cfg
home = /usr/bin
vs
$ virtualenv --python python3.10 virtualenv
created virtual environment CPython3.10.0.final.0-64 in 114ms
creator CPython3Posix(dest=/home/cyril/work/cpython/virtualenv, clear=False, no_vcs_ignore=False, global=False)
seeder FromAppData(download=False, pip=bundle, setuptools=bundle, wheel=bundle, via=copy, app_data_dir=/home/cyril/.local/share/virtualenv)
added seed packages: pip==21.3.1, setuptools==58.5.3, wheel==0.37.0
activators BashActivator,CShellActivator,FishActivator,NushellActivator,PowerShellActivator,PythonActivator
$ grep home virtualenv/pyvenv.cfg
home = /usr
home
is:
-
/usr/bin
withvenv
-
/usr̀
withvirtualenv
.
I would expect to have the same value (/usr/bin
).
the value of the home key is the directory containing the Python executable used to create this virtual environment
Environment
Provide at least:
- OS: ubuntu 21.10
-
pip list
of the host python wherevirtualenv
is installed:
Package Version
--------------------------------- -------
backports.entry-points-selectable 1.1.1
distlib 0.3.3
filelock 3.4.0
pip 21.3.1
pkg_resources 0.0.0
platformdirs 2.4.0
setuptools 59.4.0
six 1.16.0
virtualenv 20.10.0
wheel 0.37.0
Output of the virtual environment creation
Make sure to run the creation with -vvv --with-traceback
:
What's the content of /usr and /usr/bin ? Perhaps both values are valid here? Can you replicate this with a docker image?
/usr
is a standard /usr
in ubuntu :)
I reproduce the same with my python in /opt/cpython
:
venv
gives home = /opt/cpython/bin
and virtualenv
gives home = /opt/cpython
or with python:3.10-alpine
:
venv/pyvenv.cfg:home = /usr/local/bin
virtualenv/pyvenv.cfg:home = /usr/local
so home
with virtualenv
is the same as venv
but without the final /bin
As this is 2 years old without updates closing it.