ich habe mit mehreren aktuelle Systeme Probleme Python mit Imports zum Laufen zu bekommen:
Win11
macOS Sonoma
Ubuntu 22.04
Auf alle drei Systeme ist eine Arduino-IDE installiert, die Python und esptools.py zum Uploaden von binaries benutzt.
alles funktioniert soweit.
Erstes Thema: Jetzt will ich aber mit Python3 esptools.py standalone ausführen.
bei Win
11: kein Problem
bei Unixoide kommt:
Code: Alles auswählen
Pyserial is not installed for /usr/local/opt/python@3.12/bin/python3.12. 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'
Code: Alles auswählen
pip install Serial
zsh: command not found: pip
~% brew install pip
==> Auto-updating Homebrew...
...
Warning: No available formula with the name "pip". Did you mean pipx, pit, pig, pcp, php, pop, pup, sip, vip or zip?
[u]pip is part of the python formula
~% brew install python
Warning: python@3.12 3.12.4 is already installed and up-to-date.
[/u]:
Zweites Thema: ich möchte folges Programm ausführen:
Code: Alles auswählen
import geocoder
ip = geocoder.ip("me")
print(ip.city)
print(ip.latlng)
ModuleNotFoundError: No module named 'geocoder'
Bei Win
Code: Alles auswählen
pip install Geocoder
Bei Unixiode
pip geht ja nicht s.o.
Code: Alles auswählen
pipx install Geocoder
Wie bringt man eine korrekte Installtion von Python+pip heute durch?
Es gibt hunderten von Tutorials, die aber anscheinend meistens überholt sind.
Wo gibt es eine, die heute funktionniert?
Danks schonmals...
Laszlo