[Python] No module named pip in venv but pip installed

Discussão em 'Python' iniciado por Stack, Maio 4, 2025.

  1. Stack

    Stack Membro Participativo

    I work in WSL Ubuntu. After instalation python3.13 dependencies from my previous projects stopped working. Venv with python 3.12 stopped activate in vscode interface. ErrorMessage:


    An Invalid Python interpreter is selected, please try changing it to enable features such as IntelliSense, linting, and debugging. See output for more details regarding why the interpreter is invalid.
    ​

    command "source venv/bin/activate" works but all libraries "could not be resolvedPylance". When I try reinstal I see error:


    ModuleNotFoundError: No module named 'pip'
    ​

    But pip installed in this venv. I can see it folders. init and main files etc. I have pip for python3.12 and I have -m venv for python 3.12. I can recreate this venv but why I can`t turn it on properly?

    Tried reinstall venv and pip for python3.12. python3 -m ensurepip is ok:


    Requirement already satisfied: pip in /usr/lib/python3/dist-packages (24.0)
    ​

    But python3.12 -m ensurepip


    ensurepip is disabled in Debian/Ubuntu for the system python.
    ​

    python3.12 -m pip --version is working also as python3.12 -m pip install and python3.12 -m pip --upgrade pip

    Continue reading...

Compartilhe esta Página