10

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

asked Mar 19, 2020 at 17:37
3
  • 1
    Do you mean to be using python 2.7? Usually 3.x is recommended as 2.7 is deprecated and no longer being supported. Commented Mar 19, 2020 at 17:50
  • What is the command that you run? esptool.py? Commented 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. Commented May 16, 2020 at 21:57

7 Answers 7

14

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
answered Aug 15, 2020 at 15:27
Sign up to request clarification or add additional context in comments.

1 Comment

"operation not permitted" while running this command on MacOS Sonoma (M1).
12

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

answered Jul 30, 2022 at 10:15

1 Comment

I update Monterey 12.5.1, i had the error. This solved it.
10

I did this for Ubuntu 20.04 LTS:

apt install python-is-python3
answered Jun 27, 2021 at 21:55

Comments

2

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:

  1. 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!

Dock
4645 silver badges14 bronze badges
answered Sep 29, 2020 at 7:40

Comments

2

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"

answered Jun 5, 2022 at 13:16

1 Comment

As it’s currently written, your answer is unclear. Please edit to add additional details that will help others understand how this addresses the question asked. You can find more information on how to write good answers in the help center.
1

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.

How to change python3 to default in linux mint

answered Jan 2, 2021 at 1:17

Comments

0

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)...

answered Jun 28, 2020 at 1:25

Comments

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.