Espressif’s instructions for installing the IDF appear to be missing some steps or perhaps it doesn’t work on Ubuntu 23.10.
https://docs.espressif.com/projects/esp-idf/en/v4.4.2/esp32/get-started/index.html
I can’t get past step 3. Running install.sh
runs into issues. How do I get around this?
griffin@Griffins-Desktop-2-Ubu-23:~/esp/esp-idf$ sudo ./install.sh esp32c3
Detecting the Python interpreter
Checking "python" ...
> > /home/griffin/esp/esp-idf/tools/detect_python.sh: line 16: python: command not found
Checking "python3" ...
Python 3.11.6
> > "python3" has been detected
Installing ESP-IDF tools
Current system platform: linux-amd64
WARNING: File /root/.espressif/idf-env.json was not found.
Creating /root/.espressif/idf-env.json
Selected targets are: esp32c3
Installing tools: riscv32-esp-elf, openocd-esp32
Installing [email protected]
Downloading riscv32-esp-elf-gcc8_4_0-esp-2021r2-patch3-linux-amd64.tar.gz to /root/.espressif/dist/riscv32-esp-elf-gcc8_4_0-esp-2021r2-patch3-linux-amd64.tar.gz.tmp
Done
Extracting /root/.espressif/dist/riscv32-esp-elf-gcc8_4_0-esp-2021r2-patch3-linux-amd64.tar.gz to /root/.espressif/tools/riscv32-esp-elf/esp-2021r2-patch3-8.4.0
Installing [email protected]
Downloading openocd-esp32-linux-amd64-0.11.0-esp32-20220411.tar.gz to /root/.espressif/dist/openocd-esp32-linux-amd64-0.11.0-esp32-20220411.tar.gz.tmp
Done
Extracting /root/.espressif/dist/openocd-esp32-linux-amd64-0.11.0-esp32-20220411.tar.gz to /root/.espressif/tools/openocd-esp32/v0.11.0-esp32-20220411
Installing Python environment and packages
pip 23.2 from /usr/lib/python3/dist-packages/pip (python 3.11)
Installing virtualenv
error: externally-managed-environment
This environment is externally managed
To install Python packages system-wide, try apt install
python3-xyz, where xyz is the package you are trying to
install.
If you wish to install a non-Debian-packaged Python package,
create a virtual environment using python3 -m venv path/to/venv.
Then use path/to/venv/bin/python and path/to/venv/bin/pip. Make
sure you have python3-full installed.
If you wish to install a non-Debian packaged Python application,
it may be easiest to use pipx install xyz, which will manage a
virtual environment for you. Make sure you have pipx installed.
See /usr/share/doc/python3.11/README.venv for more information.
note: If you believe this is a mistake, please contact your Python installation or OS distribution provider. You can override this, at the risk of breaking your Python installation or OS, by passing --break-system-packages.
hint: See PEP 668 for the detailed specification.
Traceback (most recent call last):
File "/home/griffin/esp/esp-idf/tools/idf_tools.py", line 1528, in action_install_python_env
import virtualenv # noqa: F401
> > ^^^^^^^^^^^^^^^^^
ModuleNotFoundError: No module named 'virtualenv'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/home/griffin/esp/esp-idf/tools/idf_tools.py", line 1860, in <module>
main(sys.argv[1:])
File "/home/griffin/esp/esp-idf/tools/idf_tools.py", line 1856, in main
action_func(args)
File "/home/griffin/esp/esp-idf/tools/idf_tools.py", line 1531, in action_install_python_env
subprocess.check_call([sys.executable, '-m', 'pip', 'install', '--user', 'virtualenv'],
File "/usr/lib/python3.11/subprocess.py", line 413, in check_call
raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command '['/usr/bin/python3', '-m', 'pip', 'install', '--user', 'virtualenv']' returned non-zero exit status 1.
It appears I need to install virtualenv
separately, so I ran sudo apt install virtualenv
.
Trying sudo ./install.sh esp32c3
again I was able to make more progress but this results in a whole bunch of compiler errors.
Installing build dependencies ... done
Getting requirements to build wheel ... error
error: subprocess-exited-with-error
Getting requirements to build wheel did not run successfully.
exit code: 1
[319 lines of output]
Compiling src/gevent/resolver/cares.pyx because it changed.
[1/1] Cythonizing src/gevent/resolver/cares.pyx
performance hint: src/gevent/libev/corecext.pyx:1291:5: Exception check on '_syserr_cb' will always require the GIL to be acquired.
Possible solutions:
1. Declare '_syserr_cb' as 'noexcept' if you control the definition and you're sure you don't want the function to raise exceptions.
2. Use an 'int' return type on '_syserr_cb' to allow an error code to be returned.
warning: src/gevent/libev/corecext.pyx:1288:0: Global name __SYSERR_CALLBACK matched from within class scope in contradiction to to Python 'class private name' rules. This may change in a future release.
warning: src/gevent/libev/corecext.pyx:1288:0: Global name __SYSERR_CALLBACK matched from within class scope in contradiction to to Python 'class private name' rules. This may change in a future release.
warning: src/gevent/libev/corecext.pyx:1288:0: Global name __SYSERR_CALLBACK matched from within class scope in contradiction to to Python 'class private name' rules. This may change in a future release.
warning: src/gevent/libev/corecext.pyx:1288:0: Global name __SYSERR_CALLBACK matched from within class scope in contradiction to to Python 'class private name' rules. This may change in a future release.
Griffin is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.