简体   繁体   中英

"exec: "python": executable file not found in $PATH

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

我创建了一个符号链接,将python与python3链接起来,它适用于我的ubuntu 18.04机器

sudo ln -s /usr/bin/python3 /usr/bin/python

我为 Ubuntu 20.04 LTS 做了这个:

apt install python-is-python3

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!

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

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"

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

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM