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

Ubuntu 20.04 pip vs pip3... #5

Open
XarkLabs opened this issue May 21, 2020 · 5 comments
Open

Ubuntu 20.04 pip vs pip3... #5

XarkLabs opened this issue May 21, 2020 · 5 comments

Comments

@XarkLabs
Copy link

XarkLabs commented May 21, 2020

The next issue I hit I have not gotten past yet. It appears that something in ESP32 toolchain wants to use "pip" and I think Ubuntu wants "pip3". Here is a log snippet:

Installing ESP-IDF tools
Installing tools: xtensa-esp32-elf, xtensa-esp32s2-elf, esp32ulp-elf, esp32s2ulp-elf, openocd-esp32
Installing xtensa-esp32-elf@esp-2020r1-8.2.0
Downloading xtensa-esp32-elf-gcc8_2_0-esp-2020r1-linux-amd64.tar.gz to /home/xark/.espressif/dist/xtensa-esp32-elf-gcc8_2_0-esp-2020r1-linux-amd64.tar.gz.tmp
Done
Extracting /home/xark/.espressif/dist/xtensa-esp32-elf-gcc8_2_0-esp-2020r1-linux-amd64.tar.gz to /home/xark/.espressif/tools/xtensa-esp32-elf/esp-2020r1-8.2.0
Installing xtensa-esp32s2-elf@esp-2020r1-8.2.0
Downloading xtensa-esp32s2-elf-gcc8_2_0-esp-2020r1-linux-amd64.tar.gz to /home/xark/.espressif/dist/xtensa-esp32s2-elf-gcc8_2_0-esp-2020r1-linux-amd64.tar.gz.tmp
Done
Extracting /home/xark/.espressif/dist/xtensa-esp32s2-elf-gcc8_2_0-esp-2020r1-linux-amd64.tar.gz to /home/xark/.espressif/tools/xtensa-esp32s2-elf/esp-2020r1-8.2.0
Installing esp32ulp-elf@2.28.51-esp-20191205
Downloading binutils-esp32ulp-linux-amd64-2.28.51-esp-20191205.tar.gz to /home/xark/.espressif/dist/binutils-esp32ulp-linux-amd64-2.28.51-esp-20191205.tar.gz.tmp
Done
Extracting /home/xark/.espressif/dist/binutils-esp32ulp-linux-amd64-2.28.51-esp-20191205.tar.gz to /home/xark/.espressif/tools/esp32ulp-elf/2.28.51-esp-20191205
Installing esp32s2ulp-elf@2.28.51-esp-20191205
Downloading binutils-esp32s2ulp-linux-amd64-2.28.51-esp-20191205.tar.gz to /home/xark/.espressif/dist/binutils-esp32s2ulp-linux-amd64-2.28.51-esp-20191205.tar.gz.tmp
Done
Extracting /home/xark/.espressif/dist/binutils-esp32s2ulp-linux-amd64-2.28.51-esp-20191205.tar.gz to /home/xark/.espressif/tools/esp32s2ulp-elf/2.28.51-esp-20191205
Installing openocd-esp32@v0.10.0-esp32-20200420
Downloading openocd-esp32-linux64-0.10.0-esp32-20200420.tar.gz to /home/xark/.espressif/dist/openocd-esp32-linux64-0.10.0-esp32-20200420.tar.gz.tmp
Done
Extracting /home/xark/.espressif/dist/openocd-esp32-linux64-0.10.0-esp32-20200420.tar.gz to /home/xark/.espressif/tools/openocd-esp32/v0.10.0-esp32-20200420
Installing Python environment and packages
Creating a new Python environment in /home/xark/.espressif/python_env/idf4.2_py2.7_env
Installing virtualenv
/usr/bin/python: No module named pip
Traceback (most recent call last):
  File "/home/xark/esp/esp-idf/tools/idf_tools.py", line 1492, in <module>
    main(sys.argv[1:])
  File "/home/xark/esp/esp-idf/tools/idf_tools.py", line 1488, in main
    action_func(args)
  File "/home/xark/esp/esp-idf/tools/idf_tools.py", line 1205, in action_install_python_env
    stdout=sys.stdout, stderr=sys.stderr)
  File "/usr/lib/python2.7/subprocess.py", line 190, in check_call
    raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command '['/usr/bin/python', '-m', 'pip', 'install', '--user', 'virtualenv']' returned non-zero exit status 1

Thanks!

@gojimmypi
Copy link
Collaborator

what do you see for pip --version? Here's mine on WSL 18.04:

$ pip3 --version
pip 9.0.1 from /usr/lib/python3/dist-packages (python 3.6)

$ pip --version
pip 19.0.2 from /home/gojimmypi/.local/lib/python2.7/site-packages/pip (python 2.7)

@XarkLabs
Copy link
Author

Hmm, it seems python2 is a cast-out by default on Ubuntu 20.04:
$ pip3 --version
pip 20.0.2 from /usr/lib/python3/dist-packages/pip (python 3.8)
$ pip --version
Command 'pip' not found, but there are 18 similar ones.

@gojimmypi
Copy link
Collaborator

gojimmypi commented May 23, 2020

It looks like this is a known problem in that they want to continue using Python 2.7. Although the issue is closed, none of those solutions worked for me in Ubuntu 20.04. (I tried the alias, links, etc)

There's this horrible hack that does seem to work:

$ wget https://bootstrap.pypa.io/get-pip.py
$ sudo python2.7 get-pip.py

and to undo this:

sudo pip2.7 uninstall pip

see also the In Ubuntu 20.04, how do I get PIP for Python 2

@XarkLabs
Copy link
Author

Okay, thanks so much for looking into this.

@gojimmypi
Copy link
Collaborator

@XarkLabs There's a vastly better solution mentioned in esp-idf #4774 that refers to the espressif docs (thanks @dobairoland!)

specifically as noted on that page:

Setting up Python 3 as default for Ubuntu and Debian
Ubuntu and Debian are still providing Python 2.7 as the default interpreter but some required packages may be missing for newer distributions. Python 3 is recommended and can be installed as follows:

sudo apt-get install python3 python3-pip python3-setuptools

Making Python 3 the default interpreter is possible by running:

sudo update-alternatives --install /usr/bin/python python /usr/bin/python3 10

I'm setting up a fresh environment and testing this now....

gojimmypi referenced this issue in gojimmypi/ulx3s-toolchain May 23, 2020
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

2 participants