python search path

Python and python framework
Post Reply
meyland
Posts: 17
Joined: Wednesday 03 January 2018 17:39
Target OS: Linux
Domoticz version: V3.8153
Location: Denmark
Contact:

python search path

Post by meyland » Wednesday 12 September 2018 20:11

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: 598
Joined: Tuesday 08 September 2015 21:44
Target OS: Raspberry Pi
Domoticz version: V4.9999
Location: NL
Contact:

Re: python search path

Post by heggink » Wednesday 12 September 2018 21:57

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.
Pi3, latest beta
RFXCOM, z-wave (AEOTEC, switches, temhum, pir, contacts),
Plugwise2py, P1 'smart'meter & solar panel
Alexa, Wifi Cams motion detection
ESP: relays, PIR & Temp/TempHum
Geofence iCloud, Bluetooth & Wifi ping
Harmony hub, Nest

meyland
Posts: 17
Joined: Wednesday 03 January 2018 17:39
Target OS: Linux
Domoticz version: V3.8153
Location: Denmark
Contact:

Re: python search path

Post by meyland » Thursday 13 September 2018 20:27

Thanks, it is now working

And now I can start to debug the code
regards

Peter

User avatar
heggink
Posts: 598
Joined: Tuesday 08 September 2015 21:44
Target OS: Raspberry Pi
Domoticz version: V4.9999
Location: NL
Contact:

Re: python search path

Post by heggink » Thursday 13 September 2018 22:14

Great! good luck.
Pi3, latest beta
RFXCOM, z-wave (AEOTEC, switches, temhum, pir, contacts),
Plugwise2py, P1 'smart'meter & solar panel
Alexa, Wifi Cams motion detection
ESP: relays, PIR & Temp/TempHum
Geofence iCloud, Bluetooth & Wifi ping
Harmony hub, Nest

Post Reply

Who is online

Users browsing this forum: No registered users and 4 guests