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

ModuleNotFoundError: No module named 'pip' #956

Closed
vorburger opened this issue Dec 10, 2024 · 2 comments
Closed

ModuleNotFoundError: No module named 'pip' #956

vorburger opened this issue Dec 10, 2024 · 2 comments
Assignees
Labels
bug Something isn't working build Build, CI, etc. (w.o. #testing)

Comments

@vorburger
Copy link
Member

Expected Behavior

CI build should be green.

Actual Behavior

CI build is currently red, see e.g. https://github.com/enola-dev/enola/actions/runs/12262655265/job/34212442653 (main) or https://github.com/enola-dev/enola/actions/runs/12263476377/job/34215094677?pr=955 for #955 :

++ .venv/bin/pip install -r requirements.txt
Traceback (most recent call last):
  File "/home/runner/work/enola/enola/.venv/bin/pip", line 5, in <module>
    from pip._internal.cli.main import main
ModuleNotFoundError: No module named 'pip'
Error: Process completed with exit code 1.

This used to "just work" (for a year, and still as recently as at least Dec 2nd just a few days ago), and I expect this to be very "stable". I'll dig into how pip is, all of a sudden, just out of the blue and by itself, not available anymore in the image - that's sort of quite strange...

@vorburger vorburger added bug Something isn't working build Build, CI, etc. (w.o. #testing) labels Dec 10, 2024
@vorburger vorburger self-assigned this Dec 10, 2024
@vorburger
Copy link
Member Author

Hm, so this works, for me, locally; clearly normally pip is supposed to be available in a venv?!

$ mkdir /tmp/test-venv-pip && cd /tmp/test-venv-pip

$ python3 -m venv .venv

$ source .venv/bin/activate

$ .venv/bin/pip

Usage:
  pip <command> [options]
...

Or does this not always work, and somehow depends on the Python version, or something?!

I COULD also try to just wipe the Python cache of the GitHub, and retry...

@vorburger
Copy link
Member Author

Or does this not always work, and somehow depends on the Python version, or something?!

Google Gemini 🔮 says: "No, you don't need to manually install pip in a newly created Python virtual environment." 🤣

I COULD also try to just wipe the Python cache of the GitHub, and retry...

Hm, that actually does seem to work! This job looks like it's (going to be) 🟢 green...

Pretty strange, and not reproducible, which I never like... but oh well. Moving on.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working build Build, CI, etc. (w.o. #testing)
Projects
None yet
Development

No branches or pull requests

1 participant