albertogeniola / MerossIot

Async Python library for controlling Meross devices
https://albertogeniola.github.io/MerossIot/
MIT License
478 stars 88 forks source link

ModuleNotFoundError: No module named 'meross_iot' #253

Closed mikesierra2 closed 1 year ago

mikesierra2 commented 1 year ago

I ran pip install meross_iot==0.4.4.4 to install this on the latest Raspbian on a Raspberry Pi 3B+. Python 3.9.2 is installed. I tried to import it to my meross.py file running in Apache, using:

from meross_iot.http_api import MerossHttpClient

but that fails with:

ModuleNotFoundError: No module named 'meross_iot'

It looks like the .py files are not installed with execution permissions.

ls -la /home/pi/.local/lib/python3.9/site-packages/meross_iot -rw-r--r-- ........ http_api.py

I did try to set the execute permissions on that one file only, and try executing my python code, but that did not help. My guess is that there are many other supporting files that also need to have permissions fixed.

Is there some way to get it to install with the correct permissions? If not, is there some guidance on the permissions that I would need to set on each individual file to get it to work?

Research indciated that this option to install may fix incorrect permissions, bit it did not python -m pip install meross_iot

Looking at the permissions on the meros_iot folder: ls -la /home/pi/.local/lib/python3.9/site-packages/meross_iot rwxr-xr-x

I am relatively new to the Linux and Python world, (coming from decades as a software developer in many other languages) so any guidance is much appreciated.

Thank you

mikesierra2 commented 1 year ago

This issue can be closed. I just uninstalled, and re-ran the install, this time with sudo. It appears that I needed to run it under sudo in order to get the correct permissions on those files.

albertogeniola commented 1 year ago

Nice to hear that.