RPi-Reporter-MQTT2HA-Daemon icon indicating copy to clipboard operation
RPi-Reporter-MQTT2HA-Daemon copied to clipboard

Pip3 install requirements txt error

Open danmrossi opened this issue 1 year ago • 7 comments

Hi All

Running latest Ubuntu Server 23.04 on a Raspberry Pi 4 with all latest apt updates/upgrades as of this morning.

Going through your install instructions step by step and I get stuck on sudo pip3 install -r requirements.txt

Error I’m stuck on and googling is no help as python debugging ain’t my skill set is:

image

danmrossi avatar Jun 24 '23 05:06 danmrossi

I ended up using —break-system-packages

danmrossi avatar Jun 24 '23 06:06 danmrossi

It looks like your OS is set to protect itself.

Installing packages (modules) for python using pip can override OS installed versions installed via it's own package manager (program installer).

You'll need to go through the requirements and use apt to install them to the system OS to get the versions it provides, they may be named differently.

Or it is saying to use virtual environments, which creates it own sandboxed(ish?) version and can run away from the OS.

Just follow the instructions given to see if it works for you, but it makes the system service setup a bit different. (note I've not done this so don't know if/what/where for this HA monitor)

Or run it as is and see what happens /doesn't work.

On Sat, 24 Jun 2023, 6:54 am Daniel, @.***> wrote:

Hi All

Running latest Ubuntu Server 23.04 on a Raspberry Pi 4 with all latest apt updates/upgrades as of this morning.

Going through your install instructions step by step and I get stuck on sudo pip3 install -r requirements.txt

Error I’m stuck on and googling is no help as python debugging ain’t my skill set is:

[image: image] https://user-images.githubusercontent.com/50608357/248446442-a806aa11-e415-4c69-96da-3b2dab50f58e.png

— Reply to this email directly, view it on GitHub https://github.com/ironsheep/RPi-Reporter-MQTT2HA-Daemon/issues/103, or unsubscribe https://github.com/notifications/unsubscribe-auth/ACYAXN3S7XY2AVPDC7BVDTLXMZ6JNANCNFSM6AAAAAAZSJ744U . You are receiving this because you are subscribed to this thread.Message ID: @.***>

bsimmo avatar Jun 24 '23 06:06 bsimmo

Yeah, that forces it but may break something on a server that it needs a different version of a python module.

If it is nothing critical then go for it :-)... As you did.

On Sat, 24 Jun 2023, 7:48 am Daniel, @.***> wrote:

I ended up using —break-system-packages

— Reply to this email directly, view it on GitHub https://github.com/ironsheep/RPi-Reporter-MQTT2HA-Daemon/issues/103#issuecomment-1605290941, or unsubscribe https://github.com/notifications/unsubscribe-auth/ACYAXNYAXF7UNVSJQD4MRGTXM2ESXANCNFSM6AAAAAAZSJ744U . You are receiving this because you are subscribed to this thread.Message ID: @.*** com>

bsimmo avatar Jun 24 '23 06:06 bsimmo

So i did the system apt install path:

sudo apt install python3-paho-mqtt pyhton3-wheel python3-sdnotify python3-unidecode python3-colorama python3-tzlocal python3-requests

which resulted in

Reading package lists... Done Building dependency tree... Done Reading state information... Done python3-colorama is already the newest version (0.4.4-1). python3-paho-mqtt is already the newest version (1.5.1-1). python3-requests is already the newest version (2.25.1+dfsg-2). python3-sdnotify is already the newest version (0.3.1-2). python3-tzlocal is already the newest version (2.1-1). python3-unidecode is already the newest version (1.2.0-1). python3-wheel is already the newest version (0.34.2-1). 0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.

compared this to the requirements file,

colorama>=0.4.3 paho-mqtt>=1.4.0 requests>=2.28.2 sdnotify>=0.3.1 tzlocal>=2.1.0 wheel>=0.29.0 Unidecode>=0.4.21

it seems requirements are met.

Trblz42 avatar Aug 23 '23 19:08 Trblz42

I believe

So i did the system apt install path:

sudo apt install python3-paho-mqtt pyhton3-wheel python3-sdnotify python3-unidecode python3-colorama python3-tzlocal python3-requests

which resulted in

Reading package lists... Done Building dependency tree... Done Reading state information... Done python3-colorama is already the newest version (0.4.4-1). python3-paho-mqtt is already the newest version (1.5.1-1). python3-requests is already the newest version (2.25.1+dfsg-2). python3-sdnotify is already the newest version (0.3.1-2). python3-tzlocal is already the newest version (2.1-1). python3-unidecode is already the newest version (1.2.0-1). python3-wheel is already the newest version (0.34.2-1). 0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.

compared this to the requirements file,

colorama>=0.4.3 paho-mqtt>=1.4.0 requests>=2.28.2 sdnotify>=0.3.1 tzlocal>=2.1.0 wheel>=0.29.0 Unidecode>=0.4.21

it seems requirements are met.

I believe this should be:

sudo apt install python3-paho-mqtt python3-wheel python3-sdnotify python3-unidecode python3-colorama python3-tzlocal python3-requests

... Unless you have a really weird python3-wheel -package, of course :)

henrikbla avatar Dec 01 '23 21:12 henrikbla

Ahhh.... Python on Raspberry Pi

The latest os has made changes. I'll need to update the install instructions for this new OS and later. I'm learning venv setup and will adjust my instructions when I figure out a good approach.

Meanwhile, Which would you see using more? A per-user setup for Venv or a per-project setup?

ironsheep avatar Dec 02 '23 23:12 ironsheep

What I do is:

cd /opt/RPi-Reporter-MQTT2HA-Daemon
mkdir venv
python3 -m venv venv # create the virtual environment
. venv/bin/activate # activate the virtual environment
pip install -r requirements.txt
python3 ISP-RPi-mqtt-daemon.py

and then in isp-rpi-reporter.service, I do

-ExecStart=/usr/bin/python3 -u /opt/RPi-Reporter-MQTT2HA-Daemon/ISP-RPi-mqtt-daemon.py
+ExecStart=/opt/RPi-Reporter-MQTT2HA-Daemon/venv/bin/python3 -u /opt/RPi-Reporter-MQTT2HA-Daemon/ISP-RPi-mqtt-daemon.py

upsuper avatar Jan 05 '24 23:01 upsuper