Questions tagged [python-3]
Use this tag when referring to the Python 3 language. This can include discussions about specific features unique to the language or perhaps when referring to software that requires Python 3 in order to function. Note that general programming questions are often better suited to Stack Overflow; use this tag only where directly relevant to the Pi.
598 questions
0
votes
0
answers
13
views
opencv won't reliably display jpeg on second monitor
I’m trying to display jpegs full screen on a second monitor on a Raspberry Pi 5 using opencv in Python.
import cv2
from pathlib import Path
from screeninfo import get_monitors, Monitor
def ...
0
votes
2
answers
443
views
I can't get my ReSpeaker 2-Mics Pi HAT V2.0 to work with my Raspberry Pi Zero 2W
I followed the Seeed wiki for set up and everything seems to be in working order but when I go and test if the ReSpeaker is getting any audio input with
python3 recording_examples/record_one_channel....
0
votes
1
answer
215
views
develop and debug Python code for Raspberry Pi in Windows
I'm new to the world of Raspberry Pi's, I have programming experience but am new to Python.
I just want to be able to develop and debug python code for a Raspberry Pi in a windows 7 or 11 environment ...
0
votes
0
answers
634
views
Could not load the Qt platform plugin
I'm using a Raspberry pi 5, I'm having issues running ultralytics and PyQt5 at the same time. The way I installed ultralytics and PyQt5 are different. First I used
sudo apt install python3-pyqt5
, ...
1
vote
2
answers
269
views
How to deal with multiple events from IR remote control?
I am trying to capture events from an IR remote control in a python loop. I am using the evdev lib
Here is my code :
import evdev
def get_ir_device():
devices = [evdev.InputDevice(path) for path ...
0
votes
1
answer
98
views
Installing a package with pip instead of apt
Python 3.9.2
pip 20.3.4 from /usr/lib/python3/dist-packages/pip (python 3.9)
I installed a package (pycomm3) with pip because it isn't available with apt.
If I start the python program from the ...
0
votes
1
answer
86
views
Can't use tkinter, and may have multiple versions of python at once?
Unfortunately, I wasn't able to make this post with all the information I wanted to give. I was originally going to post it from the RPi 400 that I was having all these problems on, but apparently ...
0
votes
1
answer
642
views
Can I control IR filter of night vision camera
I'm using night vision camera (PIS-1138) with Raspberry Pi 4 and Picamera2 Python3 library successfully.
However, the camera seems to switch some sort of IR filter automatically on/off based on the ...
-2
votes
1
answer
131
views
RPi 5 Python Shhutdown command shutsdown then reboots
The issue I am facing is that my RPi 5 running bookworm is running a heavily modified version of the script found on https://learn.sparkfun.com/tutorials/raspberry-pi-safe-reboot-and-shutdown-button/...
-1
votes
2
answers
1k
views
on bookworm cant use picamera2 with opencv-python
installed opencv--python on bookworm os
when using picamera2 i get this error:
QObject::moveToThread: Current thread (0x7f6802fd50) is not the object's thread (0x7f6822efb0).
Cannot move to target ...
-1
votes
1
answer
591
views
SPI sending and receiving data
I hope you can help.
I am currently using a raspberry pi 4b and want to be able to use the SPI capabilities. For my pi I have SPI0 and SPI1. The pins used are as follows;
SPI0_MOSI - pin 19 (BCM_10)
...
1
vote
1
answer
711
views
Adding a WiFi network with Python over bluetooth
I'm working on a project where a mobile app can find and pair with a headless raspberry pi running Pi OS (Debian Buster Port) over bluetooth, send it an ssid and password and it'll create and hop on ...
0
votes
2
answers
156
views
Why does this GPIO button click run twice if I remove the print statement?
I run this script when the Raspberry Pi boots. When a key is pressed (GPIO 19) the interrupt function gets called.
If I remove the print("BUTTON PRESSED") statement on line 10, the interrupt ...
0
votes
1
answer
48
views
Raspbian Show Service status via LED not finding substring in output
So im trying to make a Python script that constantly tests if a services is running and output the status via a red LED. I have a script:
import RPi.GPIO as GPIO
import time
import os
...
0
votes
1
answer
99
views
Convert from physical pins to I2C
I have a QR code scanner that uses wiegand protocol, have used this code for it, it worked fine for physical pins, but now I have another board onto the Pi, an extender board that uses i2c protocol, ...
0
votes
0
answers
91
views
How can I make some videos in the GUI that was designed using qt5 run in a loop?
I have some videos in a GUI that plays when certain conditions are met. The problem I have is that I am unable to make the videos start again after they end. Here is the code for the UI:
import os
...
1
vote
0
answers
555
views
Use pip cache for docker builds
I want to install python packages within docker containers.
Since the build of some packages is time-consuming and sometimes fails, I want to use a cache that is reused.
I found the mount type cache ...
0
votes
0
answers
111
views
waiting for dbus address to appear error
I'm trying to run my Python executable on startup but I'm getting an error (waiting for dbus address to appear error) continuously it can't stop. Is there any way to stop I tried to update and upgrade ...
1
vote
0
answers
215
views
PCA 9685 i2c communication issue
I would like to ask a question regarding the usage of secondary channel of i2c in rpi 4b.
I have enabled the secondary channel through adding "dtoverlay=i2c-gpio,bus=2,i2c_gpio_sda=22,...
0
votes
0
answers
179
views
python script for 4x4 keypad, some buttons not working
I'm trying to use a python script to make a connection with my 4x4 keypad on Raspberry (RPi.GPIO). The code does not work correctly, because the first and second rows do not respond. I'm trying to use ...
1
vote
0
answers
96
views
Tkinter GUI not starting on boot with ROS
I'm trying to launch a tkinter GUI I made that is used to read GPIO pins as well as some ROS topics. I'm using Buster 10 and ROS Melodic with Python 3.7. I am using Clearpath's robot_upstart package ...
0
votes
0
answers
65
views
LoRa HAT communication module don't send anything
I'm working now an long range communication system, and I need help. I can't use GSM, WIFI, etc. I test one LoRa Raspberry pi shield, and I bought this: link, and I have followed this tutorial. Ofc I ...
1
vote
1
answer
155
views
How to get measured(analog/digital) output from 801s vibration sensor? [closed]
I have Rpi3B+, 801s vibration sensor and a ADC. I need the analog output to plot a graph for analysis. Basically I need to observe how vibration is affecting the other properties of the machine. ...
2
votes
1
answer
3k
views
(raspberrypi) ImportError: Unable to import required dependencies: numpy
I use raspberrypi 4 ; 32 bit, linux run python
error occur:
ImportError: Unable to import required dependencies: numpy
Original error was: libcblas.so.3: cannot open shared object file: No
such file ...
1
vote
1
answer
2k
views
Trouble using Tensorflow: SyntaxError
I'm trying to use the LSTM neural network found here on my Raspberry Pi 4 Model B
https://machinelearningmastery.com/text-generation-lstm-recurrent-neural-networks-python-keras/
I have trouble running ...