Skip to content
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

pip not available error with 2.1.0 #121

Open
Alex-Izquierdo opened this issue Nov 19, 2024 · 2 comments
Open

pip not available error with 2.1.0 #121

Alex-Izquierdo opened this issue Nov 19, 2024 · 2 comments

Comments

@Alex-Izquierdo
Copy link

Hello.
We have detected an issue in https://github.com/ansible/event-driven-ansible CI pipelines where we are using tox-extra, after the release of 2.1.0 we have the issues with the missing pip module:

py39-unit: commands[1]> sh -c 'ansible-test units --color --requirements --target-python default -v --num-workers 1 --coverage --truncate 0 '
Configured locale: en_US.UTF-8
Loaded configuration: tests/config.yml
Creating container database.
Run command: /home/runner/work/event-driven-ansible/event-driven-ansible/ansible_collections/ansible/eda/.tox/py39-unit/bin/python3 -c 'import cryptography'
Installing requirements for Python 3.9
Stream command with data: /home/runner/work/event-driven-ansible/event-driven-ansible/ansible_collections/ansible/eda/.tox/py39-unit/bin/python3
Execute command: /home/runner/work/event-driven-ansible/event-driven-ansible/ansible_collections/ansible/eda/.tox/py39-unit/bin/python3 /tmp/ansible-test-7bbql1k9-pip.py install --disable-pip-version-check coverage==6.5.0
pip is unavailable: Error while finding module specification for 'pip.__main__' (ModuleNotFoundError: No module named 'pip')
A command failed with status 1: /home/runner/work/event-driven-ansible/event-driven-ansible/ansible_collections/ansible/eda/.tox/py39-unit/bin/python3 /tmp/ansible-test-7bbql1k9-pip.py install --disable-pip-version-check coverage==6.5.0
Run command with data: /home/runner/work/event-driven-ansible/event-driven-ansible/ansible_collections/ansible/eda/.tox/py39-unit/bin/python3
FATAL: Python 3.9 at "/home/runner/work/event-driven-ansible/event-driven-ansible/ansible_collections/ansible/eda/.tox/py[39](https://github.com/ansible/event-driven-ansible/actions/runs/11916926494/job/33210780079#step:8:40)-unit/bin/python3" does not have pip available.
py39-unit: exit 1 (1.08 seconds) /home/runner/work/event-driven-ansible/event-driven-ansible/ansible_collections/ansible/eda> sh -c 'ansible-test units --color --requirements --target-python default -v --num-workers 1 --coverage --truncate 0 ' pid=5567

Pinning the version to the previous version, 2.0.2, solves the problem.

@ssbarnea
Copy link
Member

The problem is not with tox-extra itself, is just that you used pip assuming that is installed in tox environments. That should not be a given. If you use pip ensure it is listed as a dependency.

deps =
  pip

Long story: uv default environments do not have pip. python venv environments do "usually" have it (behaviour can be changed with environment variables).

@cidrblock cidrblock reopened this Nov 22, 2024
@cidrblock
Copy link
Collaborator

The issue here the addition of tox-uv requires that all users switch to UV or address CI issues related to pip.

This was a breaking change and not noted as such.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants