tox icon indicating copy to clipboard operation
tox copied to clipboard

tox4: .tox/.tox/bin/python: No module named tox

Open ssbarnea opened this issue 2 years ago • 4 comments

While trying to force use of tox 4 beta on GHA, I found an interesting error which I was not able to reproduce locally.

Successfully installed ...
[295](https://github.com/ansible/ansible-lint/runs/6224866356?check_suite_focus=true#step:6:295)
ROOT: 30691 I exit 0 (30.15 seconds) /home/runner/work/ansible-lint/ansible-lint> python -I -m pip install -e '.[test]' pid=1651 [tox/execute/api.py:275]
[296](https://github.com/ansible/ansible-lint/runs/6224866356?check_suite_focus=true#step:6:296)
ROOT: 30692 W provision> .tox/.tox/bin/python -m tox --parallel auto --parallel-live --notest --skip-missing-interpreters false -vv [tox/tox_env/api.py:398]
[297](https://github.com/ansible/ansible-lint/runs/6224866356?check_suite_focus=true#step:6:297)
/home/runner/work/ansible-lint/ansible-lint/.tox/.tox/bin/python: No module named tox
[298](https://github.com/ansible/ansible-lint/runs/6224866356?check_suite_focus=true#step:6:298)

[299](https://github.com/ansible/ansible-lint/runs/6224866356?check_suite_focus=true#step:6:299)
Error: Process completed with exit code 1.

Full run at https://github.com/ansible/ansible-lint/runs/6224866356?check_suite_focus=true#step:6:297

I tried to run the same commands as GHA locally but I still did not get into this error so I am unsure what is causing it, especially as I seen all the steps before this point as succeeding in installing dependencies.

ssbarnea avatar Apr 29 '22 08:04 ssbarnea

I can't tell what it's and without a reproducible is unactionable so I'll close it for now. We can reopen it when we ran into it again or we can reproduce it.

gaborbernat avatar May 01 '22 19:05 gaborbernat

I updated the pull request to only upgrade tox and it does reproduce 100% of the time, see https://github.com/ansible/ansible-lint/pull/2097

ssbarnea avatar May 03 '22 13:05 ssbarnea

I was able to get more reproducing info. Apparently this happens only on Debian machines when you add a plugin requires. I removed my tox-extra plugin and it worked. I tried adding another plugin tox-gh and the behavior was the same, reproducing the bug:

# tox -e lint
ROOT: will run in automatically provisioned tox, host /usr/bin/python3 is missing [requires (has)]: tox-extra>=0.4.0
ROOT: provision> .tox/.tox/bin/python -m tox -e lint
/root/.cache/.rmux/ansible-lint/.tox/.tox/bin/python: No module named tox

As both plugins reproduced the issue, I would rule-out them being the cause for the failure.

Note: i tested locally with a clean Debian 11 (bullseye) but GHA is using Ubuntu, thus I concluded that it should be either Debian or Linux, as on MacOS it worked just fine.

ssbarnea avatar May 04 '22 07:05 ssbarnea

This but is likely a duplicate of https://github.com/tox-dev/tox/issues/2414 which is better described.

ssbarnea avatar May 25 '22 06:05 ssbarnea