I am running Arduion IDE 1.8.12 on Ubuntu 18.04.4 LTS.
I am trying to compile Example code for ESP32 Camera module (standard camera module with default example on Arduino IDE) and I got this error (which I think is not Arduino issue, but Python):
"exec: "python": executable file not found in $PATH
Error compiling for board ESP32 Wrover Module"
Same message with all ESP32.
I also did sudo apt install python. Got back this:
Reading package lists... Done
Building dependency tree
Reading state information... Done
python is already the newest version (2.7.15~rc1-1).
0 modernizētas, 0 instalētas no jauna, 0 tiks noņemtas un 6 netiks modernizētas.
When I type Python in Terminal, got this back:
Python 2.7.17 (default, Nov 7 2019, 10:07:09)
[GCC 7.4.0] on linux2
Type "help", "copyright", "credits" or "license" for more information.
Thank you for help!
BR, Valters
-
1Do you mean to be using python 2.7? Usually 3.x is recommended as 2.7 is deprecated and no longer being supported.Rashid 'Lee' Ibrahim– Rashid 'Lee' Ibrahim2020年03月19日 17:50:08 +00:00Commented Mar 19, 2020 at 17:50
-
What is the command that you run? esptool.py?rolf82– rolf822020年03月19日 18:38:11 +00:00Commented Mar 19, 2020 at 18:38
-
@Rashid'Lee'Ibrahim the version of python installed on Ubuntu and other Debian based distros is 2.7, so it is not unusual to see 2.7 used. Also, I have updated the version of python to 3.6.9 and I am getting the same problem.Eoghan– Eoghan2020年05月16日 21:57:42 +00:00Commented May 16, 2020 at 21:57
7 Answers 7
I created a symbolic link as such, linking python with python3, it worked for my ubuntu 18.04 machine
sudo ln -s /usr/bin/python3 /usr/bin/python
1 Comment
In MacOS running this command in Terminal.app under your current user
sed -i -e 's/=python /=python3 /g' ~/Library/Arduino15/packages/esp32/hardware/esp32/*/platform.txt
seems to fix it.The command modifies all the platform.txt files under your local installation of the ESP32 tools (~/Library/Arduino15/packages/esp32/hardware/esp32) and replaces the word python by python3 wherever it finds it
1 Comment
I did this for Ubuntu 20.04 LTS:
apt install python-is-python3
Comments
To solve & Fixed the following upload error from Arduino To ESP32-CAM (And for ESP32 too): environment: ubuntu 20.04 64bit, Arduino 1.8.13 ESP32-CAM And yp-05 (for ESP's serial connection)
- exec: "python": executable file not found in $PATH
- Error compiling for board AI Thinker ESP32-CAM.
The solution is:
- Installing the package (for example python-is-python3_3.8.2-4_all):
sudo dpkg -i python-is-python3_3.8.2-4_all.deb
2) Wiring
WIRES colors: | black | NO | WHITE | GRAY | BROWN | EMPTY
yp-05 legs ordere: | GRD | EMPTY | VCC | TX | RX | DIR
esp32s CAM: | GRD | EMPTY | 3.3V | GPIO 3 UOR | GPIO 1 UOT | EMPTY
*** just For Upload: SHORT ESP32-CAM 100 & GRD
I hope it will save time to start using ESP32-CAM (And ESP32 too).
That's it - Solved & Run!
Comments
If you are on MacOs 12 and above please edit the platform file, change from python to python3 as follows; preferences->user/path/arduino/packages/hardware/esp32/version/platform.txt and edit the line that looks as follows:tools.gen_esp32part.cmd=python3 "{runtime.platform.path}/tools/gen_esp32part.py"
1 Comment
Rather than make a symlink, on Ubuntu and derivatives, you can make "python" the default with the alternatives facility. See this question and answer, but just reference python3 rather than python3.6.
Comments
I ran into this today (building for the TTGO T-Watch 2020); it was because I was using the Flatpak version of Arduino and it didn't include a straight python binary (only python3).
Confirmed with:
$ flatpak run --command=ls cc.arduino.arduinoide -l /usr/bin/|grep python
lrwxrwxrwx 1 nfsnobody nfsnobody 9 Feb 5 16:30 python3 -> python3.7
-rwxr-xr-x 2 nfsnobody nfsnobody 14512 Jan 1 1970 python3.7
lrwxrwxrwx 1 nfsnobody nfsnobody 17 Feb 5 16:30 python3.7-config -> python3.7m-config
lrwxrwxrwx 1 nfsnobody nfsnobody 9 Feb 5 16:30 python3.7m -> python3.7
-rwxr-xr-x 2 nfsnobody nfsnobody 3309 Jan 1 1970 python3.7m-config
lrwxrwxrwx 1 nfsnobody nfsnobody 16 Feb 5 16:30 python3-config -> python3.7-config
I'm not sure of the "right" solution, but after some trial and error the winning workaround seemed to be:
$ cd /var/lib/flatpak/runtime/org.freedesktop.Platform/x86_64/19.08/active/files/bin
$ sudo ln -s python3 python
Of course, then I ran into another problem (no pyserial)...