-
-
Notifications
You must be signed in to change notification settings - Fork 523
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
tox is fooled by __PYVENV_LAUNCHER__ #1689
Comments
This is a CPython venv bug. Fixed by python/cpython#9516. It's also fixed within virtualenv here pypa/virtualenv#1704. So my recommendation will be to use virtualenv over venv when creating the virtual environment to install tox into. I'm not totally clear if tox should patch itself to facilitate a venv bug... 🤔 |
I agree this bug is silly (also: no idea what the heck is this However, the bug means that So I guess, because of this bug, you would explain in the tox install instructions that I would simply remove that silly env var and avoid all of the confusion... with a note to get rid of it once we're through this silliness |
Note also that the fix you mention in pypa/virtualenv#1704 does not help. You can see that tox does not work even when it uses the latest virtualenv. The bug occurs before that. The bug simply means that whoever tries to I used to work around this issue by installing tox with an old python2 venv just to avoid this issue... Now I want to get rid of py2 entirely, so I took the time to report this bug (I was already working around it for months...). |
The bug seems to occur here exactly: https://github.com/tox-dev/tox/blob/master/src/tox/venv.py#L807
|
I think this should not be the case anymore with tox 4, and there's no fix on our side other than that. |
Environment
Description
OSX's system python seems to define the infamous
__PYVENV_LAUNCHER__
env var... and that foolstox
(like many other tools...). It doesn't matter which version ofvirtualenv
orpip
you may have. Iftox
runs from its own dedicated venv created by an OSX system python (or one that uses a similar approach), yourtox
will not be usable and will fail withNo module named pip
.Expected behavior
tox
should work even if the python that was used to create the venv where it lives was OSX's system python.How to Reproduce
Here's how to reproduce this. In a temp directory, create 2 files:
tox.ini
with these contents:repro.sh
to conveniently reproduce this:Now ensure that you have the python versions mentioned in
tox.ini
, in my case I use pyenv and this is what mywhich -a python
shows:Run the script
bash -x ./repros.sh
on an OSX 10.15.6 machine (any version should do), you will see that tox here complains aboutNo module named pip
...The tox target that matches your version of
/usr/bin/python3
will work, but the other 2 won't.Now, if you edit
mytox/bin/tox
and add these 3 lines:Then you will observe that
./mytox/bin/tox
now works fine (for any pyNN version).The text was updated successfully, but these errors were encountered: