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

install.bat fails on Ubuntu 18 with Python 3.6.9: The path python2 (from --python=python2) does not exist (IDFGH-6386) #8045

Closed
georgik opened this issue Dec 9, 2021 · 0 comments
Labels
Resolution: Done Issue is done internally Status: Done Issue is done internally

Comments

@georgik
Copy link
Collaborator

georgik commented Dec 9, 2021

Environment

  • Development Kit: none
  • IDF version (run git describe --tags to find it): v4.3.1
  • Build System: idf.py
  • Operating System: Linux - Ubuntu 18
  • Using an IDE?: No

Problem Description

Environment: Ubuntu 18, installed package python3-python (3.6.9), NO python 2 package installed, NO python-minimal

install.bat fails with error:

Creating a new Python environment in /home/georgik/.espressif/python_env/idf4.3_py3.6_env
The path python2 (from --python=python2) does not exist
Traceback (most recent call last):
  File "/home/georgik/projects/rust-build/rust-esp32-std-demo/.embuild/espressif/esp-idf-v4.3.1/tools/idf_tools.py", line 1675, in <module>
    main(sys.argv[1:])
  File "/home/georgik/projects/rust-build/rust-esp32-std-demo/.embuild/espressif/esp-idf-v4.3.1/tools/idf_tools.py", line 1671, in main
    action_func(args)
  File "/home/georgik/projects/rust-build/rust-esp32-std-demo/.embuild/espressif/esp-idf-v4.3.1/tools/idf_tools.py", line 1380, in action_install_python_env
    stdout=sys.stdout, stderr=sys.stderr)
  File "/usr/lib/python3.6/subprocess.py", line 311, in check_call
    raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command '['/usr/bin/python', '-m', 'virtualenv', '/home/georgik/.espressif/python_env/idf4.3_py3.6_env']' returned non-zero exit status 3.

Manual execution of: /usr/bin/python3 -m virtualenv /home/georgik/.espressif/python_env/idf4.3_py3.6_env' returns:

The path python2 (from --python=python2) does not exist

Root-cause: install.sh is not explicit about binary for virtualenv. Creation of virtualenv picks different Python than running instance.
Correct solution is to pass parameter -p with explicit path to the Python.
The similar solution is already in Windows Installer: https://github.com/espressif/idf-installer/blob/main/src/InnoSetup/Environment.iss#L423
Correct line should look like this:

/usr/bin/python3 -m virtualenv /home/georgik/.espressif/python_env/idf4.3_py3.6_env' -p /usr/bin/python3 --seeder pip

Note: do not forget seeder pip to avoid further problems.

Expected Behavior

Installation works.

Actual Behavior

Installation fails with message above.

Workaround: sudo update-alternatives --install /usr/bin/python2 python2 /usr/bin/python3.6 1

Steps to reproduce

  1. make sure to have Ubuntu 18, with python3 and no python (2)
  2. clone ESP-IDF
  3. execute ./install.bat
@espressif-bot espressif-bot added the Status: Opened Issue is new label Dec 9, 2021
@github-actions github-actions bot changed the title install.bat fails on Ubuntu 18 with Python 3.6.9: The path python2 (from --python=python2) does not exist install.bat fails on Ubuntu 18 with Python 3.6.9: The path python2 (from --python=python2) does not exist (IDFGH-6386) Dec 9, 2021
@espressif-bot espressif-bot added Status: In Progress Work is in progress Resolution: NA Issue resolution is unavailable Status: Done Issue is done internally Resolution: Done Issue is done internally and removed Status: Opened Issue is new Status: In Progress Work is in progress Resolution: NA Issue resolution is unavailable labels Jan 4, 2022
espressif-bot pushed a commit that referenced this issue Jan 26, 2022
- Check if pip is installed for sys.executable before attempting to
  create the virtual environment, bail out with an error if not.
- Don't pass --seeder argument to virtualenv if its version is
  too old. For example, on Ubuntu 18.04, virtualenv 15.1.0 doesn't
  support this argument.
- Pass --python argument to virtualenv to request specific interpreter
  to be used.

Closes #8045
dskulina pushed a commit to playable-tech/esp-idf that referenced this issue Feb 4, 2022
- Check if pip is installed for sys.executable before attempting to
  create the virtual environment, bail out with an error if not.
- Don't pass --seeder argument to virtualenv if its version is
  too old. For example, on Ubuntu 18.04, virtualenv 15.1.0 doesn't
  support this argument.
- Pass --python argument to virtualenv to request specific interpreter
  to be used.

Closes espressif#8045
dskulina pushed a commit to playable-tech/esp-idf that referenced this issue Feb 5, 2022
- Check if pip is installed for sys.executable before attempting to
  create the virtual environment, bail out with an error if not.
- Don't pass --seeder argument to virtualenv if its version is
  too old. For example, on Ubuntu 18.04, virtualenv 15.1.0 doesn't
  support this argument.
- Pass --python argument to virtualenv to request specific interpreter
  to be used.

Closes espressif#8045
espressif-bot pushed a commit that referenced this issue Feb 24, 2022
- Check if pip is installed for sys.executable before attempting to
  create the virtual environment, bail out with an error if not.
- Don't pass --seeder argument to virtualenv if its version is
  too old. For example, on Ubuntu 18.04, virtualenv 15.1.0 doesn't
  support this argument.
- Pass --python argument to virtualenv to request specific interpreter
  to be used.

Closes #8045
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Resolution: Done Issue is done internally Status: Done Issue is done internally
Projects
None yet
Development

No branches or pull requests

2 participants