python2 no more supported

128 views
Skip to first unread message

Rachade Issaka

unread,
Jan 23, 2022, 10:06:35 AM1/23/22
to PrivateEyePi
I m using Raspberry 4 with bullseye as image. Since python3 is the standart installed version there and python2 is no more supported, I couldnt install nether numpy or pyserial. have u already updated your code for using with python3 or do u have a solution ?

Glenn Seaton

unread,
Feb 23, 2022, 12:53:03 PM2/23/22
to PrivateEyePi
The PEP applications  have been upgraded to support python 3 and are available for download on at https://projects.privateeyepi.com/home/install-privateeyepi.php
The rf_tools have been upgraded to work with python 3 and are still backward compatible with python 2.  They are the default download at https://github.com/JemRF/rf_tools

The application numpy has a python 3 version, to install use  the command: pip3 install numpy

iko...@gmail.com

unread,
Mar 29, 2022, 4:33:55 PM3/29/22
to PrivateEyePi
Can someone post a working dallas.py example for Python3?
My old setup stopped working so I upgrade to Jessie with Python 3, but when I run "Sudo python dallas.py" i get the following errors:

An exception of type TypeError occurred. Arguments:
("argument should be integer or bytes-like object, not 'str'",)
argument should be integer or bytes-like object, not 'str'

Any help would be appreciated!

Thanks
DG

Glenn Seaton

unread,
Mar 29, 2022, 5:13:29 PM3/29/22
to PrivateEyePi
Did you download the python3 version of the apps?
The dallas.py was upgraded to work under python3.
The links to python 2 and python 3 of the apps are on the Install Upgrade page
 
Jessie still has Python 2.7 which should still be on your system as the default when you enter python.
If you did not get the python3 version, dallas.py version 2 should still work with the "python dallas.py" command like you had been doing.

If you did upgrade the apps to python3, an that failed, there should have been a failed at line xxx as part of the message.  I would need that to help find a problem.

Glenn

Glenn Seaton

unread,
Apr 2, 2022, 12:24:43 AM4/2/22
to PrivateEyePi

There was an issue with the python 3 upgrade that caused the dallas.py error.

The problem was the string split function under Python 2 did not care if the string to split was empty.  It returned a blank result.
The same String Split function under Python 3, if the string is empty, processes it as a bad format and fails.
I have added checks in the alarmfunctions.py code, to test for empty and continue working.
The current alarmfunctions.py for Python 3 is now Version 15.00.
I tested the dallas.py application. It reads my hardwired sensor under python 3 and sends reading to the server.
The updated  pep_python3.zip is online and can be downloaded.

Glenn
On Tuesday, March 29, 2022 at 3:33:55 PM UTC-5 iko...@gmail.com wrote:
Reply all
Reply to author
Forward
0 new messages