Page 1 of 1

Sollte das Modulverzeichnis von Python mit der Python-Version übereinstimmen?

Posted: 03 Jan 2025, 11:27
by Guest
Fehlermeldung
Kontext: MacOS Ventura (Intel Imac)
Python-Code:

Code: Select all

import paho.mqtt.client as mqtt
Fehler kehrt zurück:

ModuleNotFoundError: Kein Modul namens „paho“

Versuche, den Paho-MQTT-Client zu installieren

Code: Select all

user@iMac ~ % pip install paho-mqtt
Requirement already satisfied: paho-mqtt in /usr/local/lib/python3.11/site-packages (2.1.0)
user@iMac ~ % pip3 install paho-mqtt
Requirement already satisfied: paho-mqtt in /usr/local/lib/python3.11/site-packages (2.1.0)
Über Homebrew: brew install libpaho-mqtt

Code: Select all

user@iMac ~ % pip list  | grep paho
paho-mqtt              2.1.0
Python-Versionen

Code: Select all

user@iMac ~ % python3 -V
Python 3.10.8
Sollte python3 -V 3.11 zurückgeben? Ich frage, weil 3.11 in /usr/local/lib/python3.11/site-packages zu finden ist.

Code: Select all

/usr/bin/python3 -V
gibt Python 3.9.6 zurück.