command failed: no module named pip WSL2 Ubuntu 20.04

mcktimo
Posts: 1
Joined: Sat Mar 06, 2021 6:47 pm

command failed: no module named pip WSL2 Ubuntu 20.04

Postby mcktimo » Sat Mar 06, 2021 7:04 pm

trying to config the Expressif-IDF 1.0.0 extension:

Running vscode on remote wsl2 target running ubuntu 20.04

Code: Select all

tim@omen:~$ pip -V
pip 20.0.2 from /usr/lib/python3/dist-packages/pip (python 3.8)

Code: Select all

Command failed: "/home/tim/.espressif/python_env/idf4.2_py3.8_env/bin/python" -m pip install --no-warn-script-location -r "/home/tim/.vscode-server/extensions/espressif.esp-idf-extension-1.0.0/requirements.txt" /home/tim/.espressif/python_env/idf4.2_py3.8_env/bin/python: No module named pip
Any ideas

ESP_bignacio
Posts: 229
Joined: Wed May 02, 2018 12:12 pm

Re: command failed: no module named pip WSL2 Ubuntu 20.04

Postby ESP_bignacio » Mon Mar 08, 2021 7:10 am

It seems pip is not part of the virtual environment created in WSL 2

Can you try to search pip in /home/tim/.espressif/python_env/idf4.2_py3.8_env/bin/ maybe it is missing.

You can either delete and re make the virtual environment (pip should be included when created with virtualenv or venv) or install pip directly in this virtual environment.

To get pip just download this script

Code: Select all

curl https://bootstrap.pypa.io/get-pip.py -o get-pip.py
and run

Code: Select all

/home/tim/.espressif/python_env/idf4.2_py3.8_env/bin/python get-pip.py

galewinston
Posts: 1
Joined: Tue Jun 15, 2021 5:43 am

Re: command failed: no module named pip WSL2 Ubuntu 20.04

Postby galewinston » Tue Jun 15, 2021 5:45 am

On Mac using brew is a better option as apt-get is not available. Command:

Code: Select all

brew install python
In case you have both python2 & python3 installed on machine

Code: Select all

python2.7 -m ensurepip --default-pip
simply should solve the issue.

If instead you are missing pip from python 3 then simply change python2.7 to python3 in the command above.

Who is online

Users browsing this forum: No registered users and 33 guests