-
-
Notifications
You must be signed in to change notification settings - Fork 1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Broken environment built via virtualenv venv
with scheme posix_local
in Debian testing bookworm
#2350
Comments
PR addressing this is welcome. |
Thank you so much for the solution! Sure it isn't a "proper" solution but it restores the behavior that I wanted and couldn't get to work! 🙈 |
I encounter the same problem with Python 3.10.4 on Ubuntu 22.04. It will result in poetry keeping recreating virtual environment on existing environment and prompting "The virtual environment found in [virtual environment path] seems to be broken". Moreover, when using |
It seems that we have the same issue in Fedora. Strange is that even we have the same installation scheme for Python 3.10 (default) and 3.11 (beta) the result is different:
|
I don't know what I did but I'm no longer able to reproduce the issue. It works fine for me with Python 3.11 beta 4 and 5. |
I think Debian needs to adapt this change: deadsnakes/python3.10@9b93d73 -- what is the best channel to let them know? More specifically: _INSTALL_SCHEMES['venv'] = _INSTALL_SCHEMES['posix_prefix'] |
I'm just going to cc @stefanor here and hope they will see it (the previous comment). |
More context in #2208 |
Just ran into this as well and I have a few observations to add in case they're helpful. Firstly, I found #1663 which describes a different broken layout but a broken layout nonetheless and so maybe related? Secondly, the
Finally for those running into this with tox, you may find tox-venv helpful. |
Besides what others in this thread have learned, I found that the problem exists when using an up to date setuptools but does not occur when using the python3-setuptools package provided by debian/ubuntu. This makes me think pypa/setuptools#3278 is related to the problem. What I'm unsure of is, doesn't virtualenv have a contract with its consumers that (regardless of the details of the Python it's creating an environment for) Edited to add: I guess this is not the case, since Windows uses "Scripts":
|
Sorry, I missed this ping. I just found the bug via the commit in virtualenv. I was debugging this from the other end. The ideal way to raise Debian issues is to file bugs in Debian's bugtracker. But also, feel free to email me / ping me on IRC / discord. |
*** Tests (all manual so far): - Ubuntu 22.04 / python3 3.10 / NO python3-distutils: ** problem fixed - Ubuntu 22.04 / python3 3.10 / WITH python3-distutils: ** still working - Debian 11 / python3 3.10 / WITH python3-distutils: ** still working - Debian 11 / python3 3.10 / WITHOUT python3-distutils: ** ok error msg *** Bugs in previous code: - Deb 11 w/o python3-distutils fails to install bootstrap pip, prints a message, and should stop, but instead goes on with "Installing bootstrap virtualenv". - Also separate commit to add commented-out "head-of-main" thing below. *** Changes since last good commit (some need to be moved to other commits) - pactivate: - Add commented-out "head of main" package for virtualenv - XXX move to a separate commit - add DEB_PYTHON_INSTALL_LAYOUT workaround - cont-test: - remove the debugging - XXX keep a check for pactivate failure: (. ./$pactivate) || fail "pactivate failed: return code $?" - XXX keep large comment about system python 3.10.x *** Stuff to document print(sysconfig.get_default_scheme()) [2350]: pypa/virtualenv#2350 [au 1415153]: https://askubuntu.com/a/1415153/354600 [2415]: https://github.com/pypa/virtualenv/pull/2415/files?diff=unified&w=0 *** Maybe document pypa/setuptools#3278
*** Tests (all manual so far): - Ubuntu 22.04 / python3 3.10 / NO python3-distutils: ** problem fixed - Ubuntu 22.04 / python3 3.10 / WITH python3-distutils: ** still working - Debian 11 / python3 3.10 / WITH python3-distutils: ** still working - Debian 11 / python3 3.10 / WITHOUT python3-distutils: ** ok error msg *** To-do: - Discuss what we want to do for testing of the workaround. Currently we test only in debian:11, which confirms that the workaround does not affect that (where it's not needed) but does _not_ confirm that the workaround does work where it is needed (ubuntu:22.04 w/o python3-distutils). *** Bugs in previous code: - Deb 11 w/o python3-distutils fails to install bootstrap pip, prints a message, and should stop, but instead goes on with "Installing bootstrap virtualenv". - Also separate commit to add commented-out "head-of-main" thing below. *** Changes since last good commit (some need to be moved to other commits) - pactivate: - Add commented-out "head of main" package for virtualenv - XXX move to a separate commit - add DEB_PYTHON_INSTALL_LAYOUT workaround - cont-test: - remove the debugging - XXX keep a check for pactivate failure: (. ./$pactivate) || fail "pactivate failed: return code $?" - XXX keep large comment about system python 3.10.x *** Stuff to document print(sysconfig.get_default_scheme()) [2350]: pypa/virtualenv#2350 [au 1415153]: https://askubuntu.com/a/1415153/354600 [2415]: https://github.com/pypa/virtualenv/pull/2415/files?diff=unified&w=0 *** Maybe document pypa/setuptools#3278
*** Tests (all manual so far): - Ubuntu 22.04 / python3 3.10 / NO python3-distutils: ** problem fixed - Ubuntu 22.04 / python3 3.10 / WITH python3-distutils: ** still working - Debian 11 / python3 3.10 / WITH python3-distutils: ** still working - Debian 11 / python3 3.10 / WITHOUT python3-distutils: ** ok error msg *** To-do: - Discuss what we want to do for testing of the workaround. Currently we test only in debian:11, which confirms that the workaround does not affect that (where it's not needed) but does _not_ confirm that the workaround does work where it is needed (ubuntu:22.04 w/o python3-distutils). *** Bugs in previous code: - Deb 11 w/o python3-distutils fails to install bootstrap pip, prints a message, and should stop, but instead goes on with "Installing bootstrap virtualenv". - Also separate commit to add commented-out "head-of-main" thing below. *** Changes since last good commit (some need to be moved to other commits) - pactivate: - Add commented-out "head of main" package for virtualenv - XXX move to a separate commit - add DEB_PYTHON_INSTALL_LAYOUT workaround - cont-test: - remove the debugging - XXX keep a check for pactivate failure: (. ./$pactivate) || fail "pactivate failed: return code $?" - XXX keep large comment about system python 3.10.x *** Stuff to document print(sysconfig.get_default_scheme()) [2350]: pypa/virtualenv#2350 [au 1415153]: https://askubuntu.com/a/1415153/354600 [2415]: https://github.com/pypa/virtualenv/pull/2415/files?diff=unified&w=0 *** Maybe document pypa/setuptools#3278
*** Tests (all manual so far): ----- Debian package ------ Tested on python3 python3-distutils result after fix ────────────────────────────────────────────────────────────────────── Ubuntu 22.04 3.10 NO problem fixed Ubuntu 22.04 3.10 YES still working Debian 11 3.9 YES still working Debian 11 3.9 NO fails with clear message *** To-do: - Discuss what we want to do for testing of the workaround. Currently we test only in debian:11, which confirms that the workaround does not affect that (where it's not needed) but does _not_ confirm that the workaround does work where it is needed (ubuntu:22.04 w/o python3-distutils). *** Bugs in previous code: - Deb 11 w/o python3-distutils fails to install bootstrap pip, prints a message, and should stop, but instead goes on with "Installing bootstrap virtualenv". - Also separate commit to add commented-out "head-of-main" thing below. *** Changes since last good commit (some need to be moved to other commits) - pactivate: - Add commented-out "head of main" package for virtualenv - XXX move to a separate commit - add DEB_PYTHON_INSTALL_LAYOUT workaround - cont-test: - remove the debugging - XXX keep a check for pactivate failure: (. ./$pactivate) || fail "pactivate failed: return code $?" - XXX keep large comment about system python 3.10.x *** Stuff to document print(sysconfig.get_default_scheme()) [2350]: pypa/virtualenv#2350 [au 1415153]: https://askubuntu.com/a/1415153/354600 [2415]: https://github.com/pypa/virtualenv/pull/2415/files?diff=unified&w=0 *** Maybe document pypa/setuptools#3278
On Ubuntu 22.04 virtualenv with the latest setuptools produces environments with Python in "local/bin" instead of "bin" (see pypa/virtualenv#2350). Closes #9931
On Ubuntu 22.04 virtualenv with the latest setuptools produces environments with Python in "local/bin" instead of "bin" (see pypa/virtualenv#2350). Closes #9931
On Ubuntu 22.04 virtualenv with the latest setuptools produces environments with Python in "local/bin" instead of "bin" (see pypa/virtualenv#2350). Closes #9931
Bumps [virtualenv](https://github.com/pypa/virtualenv) from 20.16.5 to 20.16.6. <details> <summary>Changelog</summary> <p><em>Sourced from <a href="https://github.com/pypa/virtualenv/blob/main/docs/changelog.rst">virtualenv's changelog</a>.</em></p> <blockquote> <h2>v20.16.6 (2022-10-25)</h2> <p>Features - 20.16.6</p> <pre><code>- Drop unneeded shims for PyPy3 directory structure (`[#2426](pypa/virtualenv#2426) <https://github.com/pypa/virtualenv/issues/2426>`_) <p>Bugfixes - 20.16.6 </code></pre></p> <ul> <li>Fix selected scheme on debian derivatives for python 3.10 when <code>python3-distutils</code> is not installed or the <code>venv</code> scheme is not avaiable - by :user:<code>asottile</code>. (<code>[#2350](pypa/virtualenv#2350) <https://github.com/pypa/virtualenv/issues/2350></code>_)</li> <li>Allow the test suite to pass even with the original C shell (rather than <code>tcsh</code>) - by :user:<code>kulikjak</code>. (<code>[#2418](pypa/virtualenv#2418) <https://github.com/pypa/virtualenv/issues/2418></code>_)</li> <li>Fix fallback handling of downloading wheels for bundled packages - by :user:<code>schaap</code>. (<code>[#2429](pypa/virtualenv#2429) <https://github.com/pypa/virtualenv/issues/2429></code>_)</li> <li>Upgrade embedded setuptools to <code>65.5.0</code> from <code>65.3.0</code> and pip to <code>22.3</code> from <code>22.2.2</code> - by :user:<code>gaborbernat</code>. (<code>[#2434](pypa/virtualenv#2434) <https://github.com/pypa/virtualenv/issues/2434></code>_)</li> </ul> </blockquote> </details> <details> <summary>Commits</summary> <ul> <li><a href="https://github.com/pypa/virtualenv/commit/26f68e205dfbe36c47fdd1886b0c0060024dbeec"><code>26f68e2</code></a> release 20.16.6</li> <li><a href="https://github.com/pypa/virtualenv/commit/b4564569171628ee839e14853a00f296686cae6a"><code>b456456</code></a> Upgrade pip and setuptools (<a href="https://github-redirect.dependabot.com/pypa/virtualenv/issues/2434">#2434</a>)</li> <li><a href="https://github.com/pypa/virtualenv/commit/3cff34f7dc46d9ad147a3d70df31e75cab77612d"><code>3cff34f</code></a> Remove outdated PyPy stdlib overrides (<a href="https://github-redirect.dependabot.com/pypa/virtualenv/issues/2426">#2426</a>)</li> <li><a href="https://github.com/pypa/virtualenv/commit/ae2594c5a822f62964f2ccef7832c26306bc66b1"><code>ae2594c</code></a> Fix test_csh when running with the original csh (<a href="https://github-redirect.dependabot.com/pypa/virtualenv/issues/2418">#2418</a>)</li> <li><a href="https://github.com/pypa/virtualenv/commit/cdf4225c689150010af8da1cc913e8f32bee06d2"><code>cdf4225</code></a> Allow empty string as version for <code>find_compatible_in_house</code> (<a href="https://github-redirect.dependabot.com/pypa/virtualenv/issues/2430">#2430</a>)</li> <li><a href="https://github.com/pypa/virtualenv/commit/3ed75b25cc0c318fc789938bf6bad9c8326da739"><code>3ed75b2</code></a> [pre-commit.ci] pre-commit autoupdate (<a href="https://github-redirect.dependabot.com/pypa/virtualenv/issues/2423">#2423</a>)</li> <li><a href="https://github.com/pypa/virtualenv/commit/445a68dffa7ba5c0af3b02ec0545b760cd8c04ba"><code>445a68d</code></a> fix building python3.10 virtualenvs on debian derivatives (<a href="https://github-redirect.dependabot.com/pypa/virtualenv/issues/2415">#2415</a>)</li> <li><a href="https://github.com/pypa/virtualenv/commit/56003ce62101c3d2cfe1a8eb82ef7defbe0d138f"><code>56003ce</code></a> Merge pull request <a href="https://github-redirect.dependabot.com/pypa/virtualenv/issues/2413">#2413</a> from pypa/release-20.16.5</li> <li>See full diff in <a href="https://github.com/pypa/virtualenv/compare/20.16.5...20.16.6">compare view</a></li> </ul> </details> <br /> [![Dependabot compatibility score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=virtualenv&package-manager=pip&previous-version=20.16.5&new-version=20.16.6)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores) Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting `@dependabot rebase`. [//]: # (dependabot-automerge-start) [//]: # (dependabot-automerge-end) --- <details> <summary>Dependabot commands and options</summary> <br /> You can trigger Dependabot actions by commenting on this PR: - `@dependabot rebase` will rebase this PR - `@dependabot recreate` will recreate this PR, overwriting any edits that have been made to it - `@dependabot merge` will merge this PR after your CI passes on it - `@dependabot squash and merge` will squash and merge this PR after your CI passes on it - `@dependabot cancel merge` will cancel a previously requested merge and block automerging - `@dependabot reopen` will reopen this PR if it is closed - `@dependabot close` will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually - `@dependabot ignore this major version` will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself) - `@dependabot ignore this minor version` will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself) - `@dependabot ignore this dependency` will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself) </details>
On Ubuntu 22.04 virtualenv with the latest setuptools produces environments with Python in "local/bin" instead of "bin" (see pypa/virtualenv#2350). Closes #9931
Issue
Debian has set the sysconfig default scheme from
posix_prefix
toposix_local
(https://lists.debian.org/debian-python/2022/03/msg00039.html). And whenposix_local
being chosen, the default./venv/bin/activate
is set to./venv/local/bin/activate
-- AND, it is BROKEN.Reproduce:
Open an empty directory and use the command
virtualenv venv
$ virtualenv venv created virtual environment CPython3.10.4.final.0-64 in 101ms creator CPython3Posix(dest=/home/yingmanwumen/Desktop/test/venv, clear=False, no_vcs_ignore=False, global=False) seeder FromAppData(download=False, pip=bundle, setuptools=bundle, wheel=bundle, via=copy, app_data_dir=/home/yingmanwumen/.local/share/virtualenv) added seed packages: pip==22.0.4, setuptools==62.1.0, wheel==0.37.1 activators BashActivator,CShellActivator,FishActivator,NushellActivator,PowerShellActivator,PythonActivator
the sysconfig scheme is
posix_local
:And the directories:
Activate the
venv
bysource ./venv/local/bin/activate
, then use the commandpip list
:It is the result of the host
pip list
!!I have found the same issue #2340.
It is easy to solve this by add
export DEB_PYTHON_INSTALL_LAYOUT='deb'
to~/.bashrc
to change sysconfig scheme fromposix_local
todeb_system
, but I think a proper solution is needed ^_^Environment
Provide at least:
pip list
of the host python wherevirtualenv
is installed:Output of the virtual environment creation
Make sure to run the creation with
-vvv --with-traceback
:The text was updated successfully, but these errors were encountered: