Docker -> customstart.sh -> install python requests -> i got lost

On various Hardware and OS systems: pi / windows / routers / nas, etc

Moderator: leecollings

Post Reply
RNEE
Posts: 7
Joined: Sunday 05 August 2018 10:13
Target OS: Raspberry Pi / ODroid
Domoticz version: 2024.7
Location: Eindhoven area
Contact:

Docker -> customstart.sh -> install python requests -> i got lost

Post by RNEE »

I moved Domoticz to Docker.
Before i had everything running in " userland" and also now (after migration) all hardware works : deCONZ, P1, garbagedata, Tuya, Goodwe, RFXCOM, Milight)

Problem is the Domoticz-deCONZ plugin (by : Smanar) keeps asking for Python Requests package :

Code: Select all

2024-10-11 13:40:23.061 deCONZ: Acquiring GIL for 'onHeartbeatCallback'
2024-10-11 13:40:23.062 deCONZ: Calling message handler 'onHeartbeat' on 'module' type object.
2024-10-11 13:40:23.062 deCONZ: onHeartbeat called
2024-10-11 13:40:23.062 deCONZ: ### Initialisation > config
2024-10-11 13:40:23.062 deCONZ: ### Request config
2024-10-11 13:40:23.062 deCONZ: Send Command /api/8********B3/config/ with None (0 in buffer)
2024-10-11 13:40:23.062 deCONZ: Making Request: http://192.168.2.48:81/api/8**********B3/config/ with params None
2024-10-11 13:40:23.062 Error: deCONZ: Your python version is missing the requests library
2024-10-11 13:40:23.062 Error: deCONZ: To install it, type : sudo -H pip3 install requests | sudo -H pip install requests
2024-10-11 13:40:23.062 deCONZ: Acquiring GIL for 'onHeartbeatCallback'
I tried everything in adding to customstart.sh in "/opt/domoticz/config : userland" :
(customstart.sh already existed)

I added to the existing script and used the base script and added (all !) :

Code: Select all

sudo apt install python3-requests
sudo apt-get -y install python3-requests
sudo -H pip3 install requests
sudo -H pip install requests
apt-get -y install python3-requests
pip3 install requests
pip install requests
Restart container with :

Code: Select all

Rene@rasp5:/opt/domoticz $ sudo docker compose up -d
[+] Running 1/1
 ✔ Container domoticz  Started   
It seems requests is not installed in the docker container.

Could use some help in getting Python request into Docker...
(maybe in future releases op Domoticz Docker container incorporate already ?)

Thank you in advance !
RNEE
Posts: 7
Joined: Sunday 05 August 2018 10:13
Target OS: Raspberry Pi / ODroid
Domoticz version: 2024.7
Location: Eindhoven area
Contact:

Re: Docker -> customstart.sh -> install python requests -> i got lost

Post by RNEE »

This question is still open.

requests > 2.4 is needed.

It seems that in the container requests 2.32.3 is installed and cannot be updated (by me ?):

Code: Select all

rene@rasp5:/opt/domoticz $ sudo docker compose exec domoticz sh
# pip install requests
Requirement already satisfied: requests in /usr/local/lib/python3.9/dist-packages (2.32.3)
Requirement already satisfied: urllib3<3,>=1.21.1 in /usr/local/lib/python3.9/dist-packages (from requests) (2.2.2)
Requirement already satisfied: idna<4,>=2.5 in /usr/local/lib/python3.9/dist-packages (from requests) (3.7)
Requirement already satisfied: certifi>=2017.4.17 in /usr/local/lib/python3.9/dist-packages (from requests) (2024.7.4)
Requirement already satisfied: charset-normalizer<4,>=2 in /usr/local/lib/python3.9/dist-packages (from requests) (3.3.2)
# 
User avatar
waltervl
Posts: 5397
Joined: Monday 28 January 2019 18:48
Target OS: Linux
Domoticz version: 2024.7
Location: NL
Contact:

Re: Docker -> customstart.sh -> install python requests -> i got lost

Post by waltervl »

2.32 is bigger than 2.4 (from 2014!) so the install is working correctly. Or you have mixed up the versions in your post.
https://pypi.org/project/requests/#history
Domoticz running on Udoo X86 (on Ubuntu)
Devices/plugins: ZigbeeforDomoticz (with Xiaomi, Ikea, Tuya devices), Nefit Easy, Midea Airco, Omnik Solar, Goodwe Solar
RNEE
Posts: 7
Joined: Sunday 05 August 2018 10:13
Target OS: Raspberry Pi / ODroid
Domoticz version: 2024.7
Location: Eindhoven area
Contact:

Re: Docker -> customstart.sh -> install python requests -> i got lost

Post by RNEE »

It has noting to do with customstart.sh, that was based on some error messages.

I found out that the errormessage isn't related to the real error. The plugin does something then breaks, and starts again when callled etc .

In the docker container are already different library's installed alongside Python 3.9, as far as i know the are sufficient for the task.

This plugin is complicated because it does a lot of things that others don't :
- make extra custom menu, showing actual recent communication output.
- connects to another Dockercontainer running deCONZ

I started to resolve upcoming errors and I got the plug-in now running to the point where it installs the custom menu and communicates well with deCONZ, values are received every minute in custom menu.

Some things have to be done before the plugin works in docker.

So this title can be closed.
Post Reply

Who is online

Users browsing this forum: No registered users and 0 guests