Eclipse IDE - No module named serial

glamperd
Posts: 1
Joined: Fri Sep 29, 2017 3:59 am

Re: Eclipse IDE - No module named serial

Postby glamperd » Wed Oct 04, 2017 1:21 am

It looks like esptool runs under Python 3 in recent versions. It's working for me, although I did initially have the 'No module named serial' problem.
My config is:
- In make menuconfig, the python command is simply 'python'
- In Eclipse, set the PATH to point to the Python3.5 environment.
- Make sure pyserial is installed for Python 3.5. This happens when you run setup.py in esptool. From the esptool readme:
esptool.py depends on [pySerial](https://github.com/pyserial/pyserial#readme) version 2.5 or newer for serial communication with the target device.

If you choose to install esptool.py system-wide by running `python setup.py install`, then this will be taken care of automatically.

ESP_Angus
Posts: 2344
Joined: Sun May 08, 2016 4:11 am

Re: Eclipse IDE - No module named serial

Postby ESP_Angus » Wed Oct 04, 2017 11:40 pm

glamperd wrote:It looks like esptool runs under Python 3 in recent versions. It's working for me, although I did initially have the 'No module named serial' problem.
Glad to hear you got this working. esptool supports Python 2 & 3, however the other Python tools integrated into IDF (which are used for partition table generation, etc.) only support Python 2 at the moment. So you may still get some odd build errors if Eclipse is using Python 3 rather than 2.

If you installed IDF with a Python 2 environment, then you should be able to redirect the Eclipse PATH to use this environment instead.

ruedigerp
Posts: 1
Joined: Sun Dec 13, 2020 11:50 pm

Re: Eclipse IDE - No module named serial

Postby ruedigerp » Sun Dec 13, 2020 11:53 pm

Hi,

Code: Select all

#> python -V
Python 3.9.0

Code: Select all

#> pip3 install virtualenv 
#> mkdir ~/venv_arduino
#> cd $_ 
#> virtualenv .
#> source ./bin/activate
#> vim ~/Library/Arduino15/packages/esp32/hardware/esp32/1.0.4/tools/esptool.py
Change:

Code: Select all

#!/usr/bin/env python
to

Code: Select all

#!/usr/bin/env python3

Code: Select all

#> pip install serial
Install arduino-cli: https://github.com/arduino/arduino-cli/releases unzip and copy to /usr/local/bin/andruino-cli
Go to your sketch folder:

Code: Select all

#> cd ~/code/adruino/esp/projektX
Compile your Code and deploy to Board:
-b is the fqbn. in this example "esp32:esp32:esp32". Change this to your Modelname
#> grep name ~/Library/Arduino15/packages/esp32/hardware/esp32/1.0.4/boards.txt
#> arduino-cli -b esp32:esp32:esp32:PSRAM=enabled,PartitionScheme=huge_app,CPUFreq=80 compile --verbose
#> arduino-cli -b esp32:esp32:esp32 upload --verbose -p /dev/tty.usbserial-A50285BI
Press the reset button on your esp32 board and have fun.
cya

Who is online

Users browsing this forum: Google [Bot] and 191 guests