espressif / esptool

Espressif SoC serial bootloader utility
https://docs.espressif.com/projects/esptool
GNU General Public License v2.0
5.6k stars 1.39k forks source link

Cannot run esptool.py on macOS Sonoma, No module named 'serial'... (ESPTOOL-880) #990

Closed rin67630 closed 4 months ago

rin67630 commented 4 months ago

Operating System

macOS 14.1

Esptool Version

4.7.0

Python Version

3.11

Full Esptool Command Line that Was Run

python3 esptool.py

Esptool Output

Pyserial is not installed for /Library/Developer/CommandLineTools/usr/bin/python3. Check the README for installation instructions.
Traceback (most recent call last):
  File "/Users/mifi/Desktop/esptool.py", line 27, in <module>
    import serial
ModuleNotFoundError: No module named 'serial'
mifi@Lenovo-MEDION-X5020 Desktop % pip install esptool        
zsh: command not found: pip
mifi@Lenovo-MEDION-X5020 Desktop % python3 -m esptool   
Pyserial is not installed for /Library/Developer/CommandLineTools/usr/bin/python3. Check the README for installation instructions.
Traceback (most recent call last):
  File "/Library/Developer/CommandLineTools/Library/Frameworks/Python3.framework/Versions/3.9/lib/python3.9/runpy.py", line 197, in _run_module_as_main
    return _run_code(code, main_globals, None,
  File "/Library/Developer/CommandLineTools/Library/Frameworks/Python3.framework/Versions/3.9/lib/python3.9/runpy.py", line 87, in _run_code
    exec(code, run_globals)
  File "/Users/mifi/Desktop/esptool.py", line 27, in <module>
    import serial
ModuleNotFoundError: No module named 'serial'

What is the Expected Behaviour?

I would expect esptool to run on Sonoma too.

More Information

Could not install esptool.py with pip, installed it with pipx.

pipx install esptool Installing to existing venv 'esptool' installed package esptool 4.7.0, installed using Python 3.12.4 These apps are now globally available

If that is wrong, and the cause of the error, please give instructions to install esptool. Thank you.

Other Steps to Reproduce

No response

dobairoland commented 4 months ago

/Users/mifi/Desktop/esptool.py

How did that file get there? Did you download it manually? If you invoke it directly then it is not ensured that the esptool's dependencies are also installed on your computer (hence the import error). Not to mention that later, even if you work around that issue, other files will be missing.

The installation instructions are here: https://docs.espressif.com/projects/esptool/en/latest/esp32/installation.html (with the link how to get pip if not found)

This was your issue (pip is not installed):

mifi@Lenovo-MEDION-X5020 Desktop % pip install esptool
zsh: command not found: pip

It is great that you found an alternative to install it. But I don't think this is an esptool issue. We cannot take care or check that all system-level dependencies are installed.