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.

Filter by
Sorted by
Tagged with
0 votes
0 answers
19 views

Changing Python Code to save video on PC, over socket, instead of Raspberry Pi

I am trying to create a project where I use opencv to detect my cat and then send the mp4 to my pc and saves it there. I can set up the socket but am struggling with the python code to send the video ...
Newbie's user avatar
  • 1
0 votes
0 answers
7 views

PyQt5 Widget Background Color Incorrect on my Pi

I have searched high and low for this problem, but cannot find anything anywhere. I have Python Version 3.8.10 and PyQt5 version 5.15.10 running in a Virtual Environment on my Py4 with 8Gb Memory ...
themetman's user avatar
0 votes
1 answer
75 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) ...
Ben's user avatar
  • 11
0 votes
0 answers
26 views

Why can’t I stream an mp4 from my RPI by opening it in the browser?

I’m new to self-hosting and am still learning what is and isn’t possible. I have a raspberrypi 4b and am running raspberry piOS Lite (bullseye). As an experiment, I uploaded an mp4 to my RPI and then ...
nslamberth's user avatar
0 votes
0 answers
15 views

_tkinter.TclError: couldn't load file "/home/tsc/.local/lib/python3.9/site-packages/tkinterDnD/linux/libtkdnd2.9.2.so"

I'm trying to run a simple script to verify the installation of customtkinter on my raspberry pi 4b. import customtkinter def button_callback(): print("button clicked") app = ...
Greg W's user avatar
  • 1
1 vote
1 answer
75 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 ...
bsautner's user avatar
  • 218
0 votes
1 answer
225 views

Python PIP not working after upgrade

How do I fix this? I was trying to upgrade my Python to 3.10.2 which works fine. However, pip is throwing errors. These are the steps I followed to upgrade: #Downloaded new version and Extracted ...
CornDevil's user avatar
0 votes
2 answers
70 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 ...
Raed's user avatar
  • 105
1 vote
1 answer
97 views

Raspbian: Visually Open Terminal Window and execute command after boot and login to desktop environment

Please god can someone help me. I've just spent the last 8 hours trying absolutely everything I can find online in every different way I can possibly think of and none of it works. Chron jobs cant ...
problemlow's user avatar
0 votes
1 answer
21 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 ...
Steve's user avatar
  • 9
1 vote
1 answer
25 views

Outputting to SH1106 display with PIL only works from loaded files [closed]

I'm dealing with a maddening bug when trying to use an OLED module (sh1106 clone, interfaced over SPI) with a raspberry pi. I have stolen the following function from https://github.com/8TN/Raspberry-...
catalogue_number's user avatar
0 votes
1 answer
42 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, ...
Martzy's user avatar
  • 3
1 vote
1 answer
176 views

Downloaded Raspberry Pi (32bit) showing up as (64bit) when verified with uname -m

I'm trying to use Raspberry Pi for a voice recognition project. I have Raspberry Pi 4 model B. I was having issue downloading PyTorch with the error of "Could not find a version that satisfies ...
user155849's user avatar
0 votes
0 answers
34 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 ...
Shamooooot's user avatar
0 votes
1 answer
90 views

How can I run at boot or autostart an app with GUI?

I have a python script with a GUI that was designed with qt5, the script runs fine whenever I run it through the terminal or Thonny IDE. But no matter how much I tried, after trying many guides, ...
Shamooooot's user avatar
0 votes
0 answers
50 views

How to get accurate SPO2 readings from MAX30100

As you can read from the title, I'm not getting accurate SPO2 readings in the output. I should be getting values of 100 and below since it is in percentage: but I keep getting values over 100 (like ...
xFragmented's user avatar
0 votes
0 answers
123 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 ...
Dronakuul's user avatar
1 vote
1 answer
124 views

How to program remotely on horribly slow Pi-2

I have an old RPi 2 B which I've loaded the latest version of Raspberry Pi OS Lite onto. I'd like to use it to make an IoT device using an TFT LCD screen to show information like the weather and my ...
Atom's user avatar
  • 113
0 votes
1 answer
31 views

Raspberry Pi musicbox after pressing next/previous button, when the track ends it fails to play next track

I have been building a little musicbox. It should play the mp3 files using mpg123. The music should start when one of the buttons (push button) is depressed (like sensor) it should start playing the ...
Sumistu's user avatar
0 votes
0 answers
37 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 ...
sathishkumar B's user avatar
0 votes
0 answers
55 views

Trouble capturing images from a Raspberry Pi camera using Python

I am having trouble capturing images from a Raspberry Pi camera using Python. The following code works fine the first time, but fails to read data from the camera on subsequent attempts: # shotFoto.py ...
ZondoX's user avatar
  • 1
1 vote
0 answers
80 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,...
user153780's user avatar
1 vote
1 answer
526 views

Updating Connector/Python for Python 3.11

Having moved to Python 3.11, I need to update Connector/Python - which requires the MariaDB Connector/C library. This library is normally installed with python -m pip install mariadb But I'm getting ...
tyddynonn's user avatar
0 votes
0 answers
91 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 ...
Jorge Augusto Wilchen's user avatar
0 votes
1 answer
183 views

Python requests is too slow with certain WI-FI connection

I'm working on a TTS app using AWS Polly in Raspberry PI 3 B+ and when I post a text using Python requests it take a long time receive the response, around 16-17 seconds. This happens only with a ...
Shyam3089's user avatar
  • 111
1 vote
0 answers
53 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 ...
jr4d's user avatar
  • 11
1 vote
1 answer
203 views

2 motors on L298N controlled with GPIO from Rpi3B .. python telling me channel already in use and motors not turning

I have adopted Electronics hub tutorial to run 2 motors from a L298N controlled by Rpi3B using GPIO. Why is my version of the code not working? I do understand that I could ignore the "channel ...
rozzers's user avatar
  • 13
0 votes
0 answers
33 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 ...
Domkrt's user avatar
  • 1
2 votes
1 answer
224 views

Raspberry Pi 4 Python not finding installed libraries

I trying to connect an OpenCV OAK-D to an R Pi 4B. I've downloaded & installed all the requirements & installed the depthai library using pip To check its there, pip3 list | grep depthai ...
DrBwts's user avatar
  • 199
1 vote
1 answer
87 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. ...
Snehal Shende's user avatar
0 votes
2 answers
144 views

How to programically detect if display is plugged in to GPIO

I've attached an ePaper display to a GPIO bonnet/HAT and have set up cronjobs to run scripts that print data onto ePaper display. If I remove the HAT and display, then how to check if it's plugged in? ...
Kuei's user avatar
  • 21
1 vote
1 answer
2k 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 ...
44 chuang's user avatar
  • 133
1 vote
0 answers
151 views

(Raspberry Pi 4 and Python) Raspberry Camera mode raise picamera.exc.PiCameraMMALError and picamera.exc.PiCameraError

System: Raspberry Pi 4 model B, use external USB Logitech camera I'm follow the youtube tutorial but get picamera.exc.PiCameraMMALError andpicamera.exc.PiCameraError Relate discussion on other site ...
44 chuang's user avatar
  • 133
1 vote
1 answer
1k 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 ...
delgado's user avatar
  • 23
1 vote
1 answer
72 views

How to give Ownership to Pi from root to Mount_Folder

Here is my workflow and the issues I want to fix. First I mount the windows shared folder on Raspberry Pi. But in order to use that, I have to mount using sudo. sudo mount.cifs //<hostname or IP ...
MyatKaung's user avatar
1 vote
1 answer
214 views

Raspberry Pi spidev CLK working but no signal on MOSI

I have a Raspberry Pi Zero W that uses this LCD screen, including its touch interface using SPI0. What I am trying to achieve is to add another SPI device that uses SPI0. I am able to successfully ...
user3699569's user avatar
1 vote
1 answer
287 views

Exposure time in PiCamera not working

I am trying to take a long exposure image (30 sec+) in python using a RPi HQ camera (https://raspberry.piaustralia.com.au/products/raspberry-pi-hq-camera and the PiCamera module). This is my code: ...
Jake's user avatar
  • 9
0 votes
0 answers
56 views

raspistill taking long time to respond

I am trying to make a long exposure time lapse camera using a RPi HQ camera and RPi zero W, in python. The code for my camera is (for a 30 sec exposure time): import subprocess filename = str(input(&...
Jake's user avatar
  • 9
0 votes
1 answer
187 views

'/dev/v4l-subdev1' node not created anymore for 16 MP Arducam with autofocus (IMX519 based) with Rpi 4B

/dev/v4l-subdev0 and /dev/v4l-subdev1 nodes used to be created before when booting up the Rpi with the ArduCam plugged in (via MIPI CSI-2 port). Now only /dev/v4l-subdev0 shows up, and I'm not sure ...
PeterGhimself's user avatar
1 vote
1 answer
98 views

why GPIO does not work when executed from python shell but works from script

When I run this python script led.py it works. import RPi.GPIO as GPIO import time GPIO.setmode(GPIO.BCM) GPIO.setwarnings(False) GPIO.setup(24,GPIO.OUT) print("LED on") GPIO.output(24,GPIO....
Ciasto piekarz's user avatar
0 votes
1 answer
608 views

Record audio whilst pressing a button in scipy

I am trying to make wedding guest answer phone for my sister. The basic idea of these things is you pick up the handset, hear a message from the host, leave you own, replace the handset, and the ...
hieronopro's user avatar
0 votes
0 answers
52 views

WorldTimeApi client_ip

I am trying to use World Time Api to get the ip address assigned by my ISP. In Micro Python on an RPi Pico W my_ip = json["client_ip"] returns an ipv4 address and in Python3 on a RPi 4B it ...
William Burlingame's user avatar
0 votes
1 answer
85 views

Raspberry pi 4 is not booting with Disk image that is working on Raspberry pi2

I am new to this project. The project was developed in 2015 using Raspberry pi2 and a 7' touch display. The disk image works perfectly on Raspberry pi 2. I tried to flash the disk image to an SD card ...
MKZ's user avatar
  • 1
2 votes
0 answers
50 views

How can I get my python program that uses the requests library to run on boot via the crontab

I am working on creating a python script to retrieve data from a server using the requests library, and then display it on an adafruit led matrix using a raspberry pi. I have a program that functions ...
ho88it's user avatar
  • 31
0 votes
0 answers
137 views

why i can't run use command python3 but it work on thonny python

it work here but it get erro when i use commend. this erro that i get 192.168.247.109 - - [15/Jul/2022 19:46:59] "GET / HTTP/1.1" 200 - OpenCV Error: Assertion failed (!empty()) in ...
ArisFYP's user avatar
0 votes
1 answer
387 views

I2C communication on Raspberry Pi 3B using smbus2

I'm trying to connect my energy measurement IC with Raspberry Pi 3B using the I2C protocol. I'm using sudo i2cdetect -y 1 to detect the connected devices and it is correctly showing the address(7-bits)...
Satya Prakash Singh's user avatar
1 vote
0 answers
308 views

Why can’t I print to this thermal printer on this python print server?

I'm trying to run a python based print server, based on these instructions, and this code. I have the print server running on a Raspberry Pi Zero. I assume the print server is working correctly, as ...
tomh's user avatar
  • 126
0 votes
0 answers
82 views

Python 2.7 and 3.x coexisting in harmony?

I'm on an RPi4 running the 64-bit version of Raspbian and want to have 2.7 and 3.x coexisting with NO problems. 3.x is part of the 64-bit Raspbian when installed. I just installed 2.7 (i.e., sudo apt ...
jski's user avatar
  • 141
1 vote
0 answers
80 views

Problem with reading GPIO input value - photoeletric sensor

Good night! I've got some problems with GPIO input values in my code (Python). I'm using a Raspberry Pi model 3, and RPi.GPIO as GPIO module. I'm tring to get the signal values of a photoeletric ...
Eduardo Carlos's user avatar
2 votes
0 answers
521 views

Need to take a screenshot headless

I have a weather station and take a screenshot of a webpage (windy.com) once an hour to integrate into my display which runs on a Pi 3 It was working perfectly until I had an SD card crash and had to ...
Lewis's user avatar
  • 21

1
2 3 4 5
12