-
Notifications
You must be signed in to change notification settings - Fork 12
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Error File "daemon.py", line 11, in <module> import paho.mqtt.client as paho ModuleNotFoundError: No module named 'paho' Solved #18
Comments
Ok got it working with a change new error debug log: solved was the clock, cannot run twice deamon |
For all people that try the same as me................ |
Files:
pi@raspberrypi:/opt/kamstrup $ ls
config.yaml daemon.py kamstrup_meter.py kamstrup_meter.pyc mqtt_handler.py
pi@raspberrypi:/opt/kamstrup $ pip install pyserial
Looking in indexes: https://pypi.org/simple, https://www.piwheels.org/simple
Requirement already satisfied: pyserial in /usr/lib/python2.7/dist-packages (3.4)
pi@raspberrypi:/opt/kamstrup $ pip install paho-mqtt
Looking in indexes: https://pypi.org/simple, https://www.piwheels.org/simple
Requirement already satisfied: paho-mqtt in /usr/local/lib/python2.7/dist-packages (1.6.1)
pi@raspberrypi:/opt/kamstrup $ pip install PyYAML
Looking in indexes: https://pypi.org/simple, https://www.piwheels.org/simple
Requirement already satisfied: PyYAML in /usr/local/lib/python2.7/dist-packages (5.4.1)
pi@raspberrypi:/opt/kamstrup $ python3 daemon.py &
[1] 1771
pi@raspberrypi:/opt/kamstrup $ Traceback (most recent call last):
File "daemon.py", line 11, in
import paho.mqtt.client as paho
ModuleNotFoundError: No module named 'paho'
after update paho-mqtt new error
pi@raspberrypi:/opt/kamstrup $ Traceback (most recent call last):
File "daemon.py", line 13, in
import yaml
ModuleNotFoundError: No module named 'yaml'
sudo -H pip3 install --ignore-installed PyYAML
update PyYAML to 6.01
pi@raspberrypi:/opt/kamstrup $ python3 daemon.py &
[1] 2778
pi@raspberrypi:/opt/kamstrup $ Traceback (most recent call last):
File "daemon.py", line 22, in
handler = TimedRotatingFileHandler('logs/debug.log', when="d", interval=1, b ackupCount=5)
File "/usr/lib/python3.7/logging/handlers.py", line 199, in init
BaseRotatingHandler.init(self, filename, 'a', encoding, delay)
File "/usr/lib/python3.7/logging/handlers.py", line 54, in init
logging.FileHandler.init(self, filename, mode, encoding, delay)
File "/usr/lib/python3.7/logging/init.py", line 1092, in init
StreamHandler.init(self, self._open())
File "/usr/lib/python3.7/logging/init.py", line 1121, in _open
return open(self.baseFilename, self.mode, encoding=self.encoding)
FileNotFoundError: [Errno 2] No such file or directory: '/opt/kamstrup/logs/debug.log'
dir made
new error
Traceback (most recent call last):
File "daemon.py", line 85, in
main()
File "daemon.py", line 81, in main
daemon = KamstrupDaemon()
File "daemon.py", line 59, in init
self.mqtt_handler.connect()
File "/opt/kamstrup/mqtt_handler.py", line 28, in connect
self.mqtt_client = paho.Client(paho.CallbackAPIVersion.VERSION1, self.client_id, True)
AttributeError: module 'paho.mqtt.client' has no attribute 'CallbackAPIVersion'
The text was updated successfully, but these errors were encountered: