The Stack Overflow podcast is back! Listen to an interview with our new CEO.

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
1answer
11 views

Invalid syntax when setting variable

When setting variable c1, it shows invalid syntax error on c1 def project(k, n): h = 200 L = 18 M = 70 da = 8 xo = h - L g = 9.81 V0 = m.sqrt(2 * g * L) W = M * g xss = -(W / k) + h ...
1
vote
2answers
24 views

Executing 2 commands in 2 different Terminal windows

I want to execute 2 python programs(both run flask servers on different ports) in 2 different terminal windows, from a single bash script. Python files: a.py and b.py Bash Script: runner.sh This is ...
0
votes
0answers
18 views

Awful Color Saturation in Datlight using pi-camera

I decided to finally post this after no avail and several videos that are unusable. I made a python script to record and convert video from a raspberry pi running in the nosecone of my rocket. However ...
1
vote
2answers
33 views

What system libraries are required to support Pillow on Raspbian Buster Lite?

After installing Pillow, I get errors such as: >>> from PIL import Image Traceback (most recent call last): File "<stdin>", line 1, in <module> File "/home/pi/env/lib/python3....
0
votes
0answers
18 views

Starting python script at startup fails after some down time

EDIT: it seems that it starts randomly I have python script and I've created in lxsession/LXDE-pi/autostart file following command: sudo /usr/bin/python3.7 /home/pi/script.py If I type this command ...
1
vote
0answers
25 views

Raspberry camera v1.2 results in kernel panic

Update I have found the following issues that might relate to this problem: Framerates below 1 are not supported (https://github.com/raspberrypi/userland/issues/575) Frequent sequential call hang (...
0
votes
2answers
12 views

Cannot connect to Xserver during CLI boot

so i want to autorun my python script after boot in a CLI boot however it seems that its giving me an error "Cannot connect to Xserver". My python script uses a camera i used crontab to autorun my ...
1
vote
2answers
46 views

Tkinter not running on updated python

So, I'm trying to use a project, that uses tkinter on my Raspberry Pi but I have an issue. I needed an updated version of Python, so I updated it to 3.7.4, however, when I try to import tkinter, it ...
0
votes
2answers
26 views

Callback parameters to GPIO.add_event_detect?

I have a button object that when pressed needs to perform something, and for this I'd need to get a property of the button. I'd like it to work like: ... GPIO.add_event_detect(button, GPIO.RISING, ...
0
votes
0answers
18 views

mbus to modbus protocol

Im trying to convert mbus protocol to modbus IP protocol with a raspberry. Im new on this, just doing bcs my boss asked. I´ve been searching on all google, but I found nothing. Any help would be ...
0
votes
1answer
39 views

Desktop no longer displays after modifying LXDE-pi autostart

I upgraded to Raspbian Buster this morning and everything worked fine, until I added a command to run a python tkinter application in the LXDE-pi autostart file. When I rebooted to test the tkinter ...
0
votes
0answers
51 views

Selenium won't run on my raspberry pi 3 Model B+

Today I recieved my Raspberry pi 3 Model B+. I downloaded NOOBS and installed it on my raspberry pi. However, I cannot run a selenium browser on it. I have tried to install iceweasel but it says that ...
0
votes
2answers
52 views

Does gpiozero need RPi.GPIO?

I'm trying out gpiozero, but after running the examples from their documentation, I still get this errors but it still runs ok. gpiozero is installed on venv using pip3 #!/usr/bin/env python from ...
1
vote
1answer
46 views

Can I just create a python thread per raspberry pi for parallel processing?

I have been looking to make a cluster of raspberry pi 4s, and have been pretty interested in it and made good head way. I have seen quite a few guides on the topic as well. I followed this one found ...
2
votes
0answers
53 views

Hardware controlled RTS on a Pi4 not working accurately

We need to use RS485 to talk to one of our custom tools. We need to use hardware controlled rts/cts. I've read so many articles about this but nobody ever says it works for them with fast timing and ...
1
vote
1answer
53 views

Cannot install pandas on Raspberry Pi

I have been trying to install pandas for a week now. Read pretty much every thread I could find but nothing seems to work. I keep getting a ton of import and dpkg errors every time. Everything is up ...
0
votes
1answer
33 views

Running script after reboot does not work

I have a simple script will runs a loop that reads off temp data in the console from a sensor and then writes it to a file. I would like to make sure that this script starts running right after my pi ...
2
votes
0answers
48 views

Waveshare ADDA (ADS1256) full scale input issues

My question is about a problem of full scale output with the Waveshare ADDA ADS1256 card. I use the Waveshare High-Precision AD/DA Board based on ADS1256 on a Raspberry Pi 3b and the Python3 examples....
1
vote
0answers
22 views

Schedule Video Recording

The code below records video for 24 hours straight which is too much. I wanna schedule the record like from 9.00am to 3.00pm only 6 hours of video. Being a novice and newbie I don't really know how to ...
0
votes
0answers
54 views

Speed drops in for-loops python on rpi

I am working with python 3.5 on rpi 3B+ and making a led matrix project. For that I would like to know at what speed my code is running each cycle. I will take the minimum and use that as a refresh ...
0
votes
1answer
25 views

spidev sanity check not working

ArchARM on Raspberry Pi 3, spidev installed from AUR. I'm trying to control a Waveshare device via SPI, and can't get SPI to work from Python. The most basic sanity test I can think of is failing: ...
-1
votes
1answer
66 views

Need a large (20 inch +) touch screen monitor Raspberry Pi 3b+/4b running Debian Buster

I'm looking for a large (20 inch +) touch screen monitor for Raspberry Pi 3b+/4b running Debian Buster. We tried the ViewSonic TD2230 but the driver support is lacking; Tkinter misses about 35% of the ...
0
votes
0answers
33 views

HC-SR04 Ultrasonic Rangefinder readings are off by a large margin

I'm making a robot that should avoid obstacles and im using a HC-SR04 to measure distances. My problem is that my readings are off by a large margin. when there is no obstacle in the way I get a ...
1
vote
0answers
20 views

I don't know why suddenly mjpg-streamer and webcam stop working

I have made a program that uses three webcams and three ultrasonic sensors using raspberry pi 3 and python 3. When each ultrasonic sensors detect stuff in front of them, webcam take a picture of it. ...
0
votes
2answers
19 views

Generating Stereo Audio in PI programmatically

I want a stereo output form the PI. The sound being played will not be a recorded sound rather it would be generated using a code (preferably python). For example, the program's input will be (x,y,z) ...
0
votes
1answer
37 views

Connecting pihut controller to pi zero. Syntax error when calling a script

Please let me know if I should provide any more information. I'm trying to connect a pihut controller to a raspberry pi zero using code I found from approxeng. I am running python 3.5. https://...
1
vote
1answer
130 views

No module named 'adafruit_circuitpython_servokit' [closed]

I have a Adafruit PWM hat and I am trying to run play around with some servos. However, when I run this line: from adafruit_servokit import ServoKit It returns: No module named '...
-1
votes
2answers
58 views

How can i convert a python script into a Raspberry Pi 3 (Raspbian) executable?

I'm designing a GUI for my Raspberry Pi 3 B+. I've written the code in Python3.5 and now I want my script to be run as executable (Raspbian package). Is it possible to do so and if possible any ...
0
votes
0answers
22 views

Could I use Processing.py to display text and shapes on a Waveshare ePaper display?

I am new to Raspberry Pi and programming in general. I have very basic knowledge on Processing.py and I would like to know is it possible I could use this library to display shapes and text on a ...
0
votes
0answers
46 views

Packages are correctly installed using pip3 in my virtual environment but are not being imported, I get ModuleNotFoundError

I am using a raspberry pi 3 with raspbian buster and python 3.7.3. I can install packages fine in my virtual environment using pip3 install. This can be seen when I use the command pip list, all my ...
0
votes
1answer
46 views

MGR996R rotation angle

Basically I want to control the angle of the rotation of the servo motor but I don't seem to know how... From the tech sheet I know this motor shouldn't be a continuous one, any hint would be ...
0
votes
0answers
8 views

Can I save and open multiple videos with OpenCV or any other module/package/method

So, I have been working on a project which requires me to open an animation/video if the user gives an input of a recognized string mentioned in my code. Basically if the word entered by the user is ...
0
votes
0answers
35 views

How to Volume control PAM8610 from RPI

Does anyone know how can I control PAM8610 module volume through code from RPI? Thanks.
1
vote
0answers
32 views

softly increasing and decreasing volume with mpg123

I am using Picroft on raspberry pi 3. In picroft, every mp3 files run with mpg123. I am creating my own device using this OS. when I say it to sing a song it starts singing by playing mp3 files and ...
0
votes
1answer
64 views

Simulating OpenCL on a Raspberry Pi using Python

Is it possible to run code on a Raspberry Pi which simulates the use of OpenCL? I am developing code on a computer which is capable of using OpenCL, and am testing this code remotely on a Raspberry ...
0
votes
0answers
514 views

ALSA Errors on Pi 3B+ using SpeechRecognition and PyAudio (Original Post missing stuff)

Using PyAudio I simply ran this piece of code: import pyaudio p = pyaudio.PyAudio() for x in range(p.get_device_count()): print(p.get_device_info_by_index(x).get('name')) Getting these Errors: ...
2
votes
1answer
45 views

Reading more than 8 bits from an SI7021 sensor

I am using the Si7021-A20 sensor on a Raspberry Pi Zero WH (headless, controlled via ssh and VNC). I want to get readings using Python (version 3). However, I have a very hard time to actually get ...
0
votes
0answers
31 views

Binding PiCamera stream to GstWidget

Well, today I began to program in Python and I'm doing a graphical app with PyGtk in Anjuta. My first objective is to get the stream of the PiCamera in a window. But I'm getting problems to manage the ...
1
vote
2answers
104 views

Raspberry Pi “Temporary failure in name resolution”

After many hours of googling and testing for a solution, I am stuck. I would really appreciate some advice. Situation - I have (5) Raspberry Pis 3B+ (RP) at various customer locations and I want to ...
0
votes
0answers
34 views

Detect fire with pi cam module

I have a python script that uses a usb cam to detect fire with opencv, it worked well until changed to the picamera and now i get this error when i run the code: File "seeFire.py", line 23, in ...
2
votes
0answers
27 views

Pin Crosstalk Issue [closed]

I'm working on a quick project with my dad for his condo. He wanted to setup a bunch of moisture sensors around the condo near sources of water (sinks, bathtubs, toilets, etc), which, if triggered, ...
1
vote
1answer
53 views

How do I reinstall Python 3?

I cannot get pip to work and I think that reinstalling python 3.7 might help. When I try 'sudo apt install --reinstall python3' I get an error saying there are unmet dependencies. If I specify it to ...
0
votes
0answers
25 views

error while opening the default python3 install in raspbian

well, i have been using python3.4.2 for sometime on my raspbian os however recently i tried to change the default to 3.7.2. unfortunately i failed to do so... i downloaded it but i couldn't make it ...
0
votes
0answers
29 views

php file not executing python script when called through browser

I have an apache2 webserver running on the pi. I have a php file that uses exec() to run a python script. Everything works well from the command line. when loaded through the browser, the exec() ...
0
votes
0answers
118 views

Simulate a mouse click in python tkinter

I have a tkinter GUI running on a Pi 3B+ with a 5" tft touch screen display. I am writing my own touch screen driver. The GUI works when I mouse click on a button that is bound to Button-1. self....
2
votes
1answer
27 views

CE1 not going low for pigpio.spi_open() with flags

I'm attempting to modify joan's test script (https://raspberrypi.stackexchange.com/a/44320/42126) for an RPi SPI master to communicate with an Atmega328P slave. I cannot change which GPIO pins I have ...
0
votes
0answers
31 views

My Relay suddenly turns on and off, and this happens in a second

Well, I had written a code for Automatic Cooling with DHT 11, but I did not get any successful result in it, I want the Relay turn on when the humidity rises up, and I did not have any errors in my ...
1
vote
1answer
60 views

Timeout function for user input on 4x4 membrane keypad with pad4pi

I'm making a python script for a 4x4 keypad that's connected to a raspberry pi where the user enters a 4 pin code and the program tells the user whether or not it's correct. In order to take in the ...
1
vote
0answers
37 views

Making Python3 default on command line

I have been trying to run the Jupyter notebook on my Pi but the Kernels will not install into Jupiter even though I downloaded them through the Pi's Software download window. A little bit stumped and ...
0
votes
0answers
26 views

Cannot turn web streaming into a function

I'm working on a project with my Raspberry Pi 0 and a camera. I'm writing my code in Python using the PiCamera module. This file handles setting up the camera and Starting Web streaming. I had no clue ...