python search path

Python and python framework

Moderator: leecollings

Post Reply
meyland
Posts: 35
Joined: Wednesday 03 January 2018 16:39
Target OS: Linux
Domoticz version: 2020.2
Location: Denmark
Contact:

python search path

Post by meyland »

Hi

I'm trying to develop a new plugin to get sea water temperature. My problem is the module "requests", which domoticz can't find. The search path is: /usr/lib64/python36.zip:/usr/lib64/python3.6:/usr/lib64/python3.6:/usr/lib64/python3.6/lib-dynload and, of course, the plugin folder. The module is installed in the folder "/usr/lib/python3.6/site-packages/" and this folder is not found in the search path.

Can anyone please help me, so I can get the temperatures

My system is Fedora 29 x64
regards

Peter
User avatar
heggink
Posts: 980
Joined: Tuesday 08 September 2015 21:44
Target OS: Raspberry Pi / ODroid
Domoticz version: 12451
Location: NL
Contact:

Re: python search path

Post by heggink »

I had a similar issue where my python installation was a bit messed up and reinstalling is not an option ATM.
I fixed it by figuring out where the package was installed and aging PYTHONPATH to domoticz.sh in /etc/init.d (services startup). Your distro may have a different path for domoticz.sh unless also Debian based. Add all the search paths to PYTHONPATH. Alternatively add the path in your python script.
Docker in Truenas scale, close to latest beta
DASHTICZ 🙃
RFXCOM, zwavejs2mqtt, zigbee2mqtt,
P1 meter & solar panel
Google home, Wifi Cams motion detection
Geofence iCloud, Bluetooth & Wifi ping
Harmony hub, Nest, lots more :-)
meyland
Posts: 35
Joined: Wednesday 03 January 2018 16:39
Target OS: Linux
Domoticz version: 2020.2
Location: Denmark
Contact:

Re: python search path

Post by meyland »

Thanks, it is now working

And now I can start to debug the code
regards

Peter
User avatar
heggink
Posts: 980
Joined: Tuesday 08 September 2015 21:44
Target OS: Raspberry Pi / ODroid
Domoticz version: 12451
Location: NL
Contact:

Re: python search path

Post by heggink »

Great! good luck.
Docker in Truenas scale, close to latest beta
DASHTICZ 🙃
RFXCOM, zwavejs2mqtt, zigbee2mqtt,
P1 meter & solar panel
Google home, Wifi Cams motion detection
Geofence iCloud, Bluetooth & Wifi ping
Harmony hub, Nest, lots more :-)
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest