• 2 Posts
  • 99 Comments
Joined 1 year ago
cake
Cake day: January 3rd, 2024

help-circle







  • No module named pip is usually because I have Python earlier than 3.9ish and the vast majority of recipes expect Python 3.9 or later.

    A virtual environment that removes access to pip certainly isn’t working as desired.

    Here’s some things your outputs tell me:

    • The system version of Python has a lot of stuff installed. So using a virtual environment is definitely worth the effort.
    • Your activate script looks fine, on a casual read. (One of the problems we have ruled out is an empty activate file.)
    • Python and pip are both installed and available on your PATH, at least before you activate the virtual environment.
    • Your virtual environment is doing things - at least enough to break pip.

    Having ruled out an empty activate file, I would check on what shell is running. Your activate script expects bash - a classic - but your SteamDeck terminal could default to something else.

    I would also try tossing a 3 at the end of the Python and pip commands. In some situations it can help a missing command be found.

    Try these:

    which python
    which pip
    python -V
    bash
    which python
    which pip
    python -V
    source .venv/bin/activate
    which python
    which python3
    python -V
    which pip
    which pip3
    pip3 freeze
    

  • Some questions that would help folks help you debug:

    • What is the output of cat .venv/bin/activate?
    • What are the results of which python both before and after running the source command?
    • What are the results of python -m pip freeze both before and after running the source command?

    Oh, and a Python pro tip - when a virtual environment misbehaves in any way, I’m pretty quick to rm -rf .venv and rebuild it, in case I did something I forgot about. (If I’ve run more than 5 commands and my venv isn’t behaving as expected, I figure I am way off track.)