Stack Exchange Network

Stack Exchange network consists of 174 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

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.

-1
votes
1answer
27 views

Python program runs with 'python3 progfile.py' but fail to start as service

I installed a python program from a github repo with an automatic script. It is configured to launch itself as a service on startup, and everything seems working fine. I edited the 'py' file to change ...
0
votes
0answers
12 views

SSLError while trying to install pip for python3.4 on Raspbian-Stretch (Armv7l)

The issue is that I have a tensorflow .whl targeted towards python3.4 but by default on raspbian-stretch python3.5 is installed so I installed python3.4 python3.4-dev using apt-get. After that i ...
0
votes
1answer
211 views

Segmentation fault error while installing opencv on raspberry pi 3. Any reason for that?

Hi everyone I hope someone could help solve this issue,I'm trying to install openCV 3.3.0 with python 3.5 on the raspberry pi 3 for the second time ( first time I got no module named cv2 ) but this ...
0
votes
0answers
10 views

Pygame initalisation for TFT on /dev/fb1 only succeeds as root

I connected a 320x240 TFT to my Raspberry Pi A+ running Raspbian stretch via SPI and set it up as fbtft_device. It shows up in /dev/fb1 and I can write images to it via pygame. I initialize it like ...
0
votes
0answers
21 views

How can I install/use smptlib in Python 3.x with Thonny

I have got this response. I have no idea how to avoid it: Traceback (most recent call last): File "/home/pi/Franz/email3.py", line 2, in <module> import smtplib File "/usr/lib/python3/...
0
votes
1answer
515 views

How to I run OMXPlayer in windowed mode from Python?

When I run this program in Python 3 it is working but the video is in full-screen. from subprocess import run videoPath = "/home/pi/video_3.h264" omx = run(["omxplayer",videoPath]) As soon as I add ...
1
vote
2answers
301 views

Raspberry Pi won't recognize nRF24L01+

I'm a Raspberry Pi n00b and a python beginner, but I have a lot of experience with DIY electronics, arduino and c#. I've tried everything I can think of, and I just can't get the Pi to recognise the ...
0
votes
1answer
256 views

Dependencies fail to install, cannot install picamera on pi3

When I run apt-get install python3-picamera it fails with different dependency issues like: files list file for package 'libparams-util-perl' is missing final newline or files list file for package '...
0
votes
0answers
27 views

MQTT connection to broker

Hello I would like to configure paho mqtt but I am having trouble to get it to work properly. I am trying to connect my raspberry to external server where broker is up and running. Port and IP are ...
1
vote
1answer
32 views

JSON not working with LIRC

I have the following script which is meant to write/read a json file. The problem is it will only write/read the file from the command line and not when using a remote via LIRC. import RPi.GPIO as ...
0
votes
1answer
64 views

prevent script running twice consecutively - Python

I have the following two Python scripts one sends a motor forward while the other script sends it backwards. Each script is operated by it's own button on a remote. Script A import RPi.GPIO as GPIO ...
-4
votes
0answers
33 views

I need help coding a toggle button for led? [duplicate]

I have hooked up my circuit and it works as a hold button to turn light on. Then when I let go of button light turns off but I have found no way to make a toggle button for led. If somebody were so ...
0
votes
2answers
53 views

How to make a button toggle a led?

I have some code which turns an led on when I hold the button. But only when I am pressing it. Could somebody help me so when I press the button then the light stays on and if I press it again the led ...
0
votes
1answer
709 views

No module named PiCamera

Trying to run a python program in a vm (virtual environment) with the picamera module, i'm running it in the vm because i have other modules there like OpenCV. When running the program i get the error:...
0
votes
0answers
16 views

Gpiozero inside custom function

So I have a odd problem. I have raspberry pi model 3 using gpiozero in python 3. Just trying to turn on the motor at half speed when calling the function. Issue is that nothing happens when ...
0
votes
1answer
20 views

Need help blinking a led continuously?

I'm new to Python and just go this Raspberry Pi, and need help blinking this led. I have got it to where the LED will blink once( Turn on for a second, then turn off). I need some help so when I hit ...
2
votes
1answer
38 views

read variable and trigger event - python

I have the following script which increases the counter variable every time a button is pressed. When counter reaches a certain number i.e. 10 lets say I want an event to trigger. from time import ...
0
votes
0answers
32 views

Not able to install the latest version of Scipy(1.2.0) on Raspbian

I have Scipy version 0.18.2 on my RaspberryPi 3. However, I need the find_peaks() function which is only available on higher versions. I followed this link to install scipy. But the python3 setup.py ...
0
votes
0answers
54 views

problem connecting with port serial0 for serial comm

I am facing this issue that I can't solve, I've been on this like 3 days and it is really frustrating! I'm trying to test AT commands through port serial0, I've tried it in a python file and when i ...
1
vote
2answers
902 views

After installing python 3.6 most modules don't work

I'm new with RPi and also Linux, so my question might be stupid but I tried to get Python 3.6 running with different ways (compiling, pyenv, berryconda). In general I think python is running on all ...
0
votes
0answers
58 views

Installing gstreamer on raspian

I am trying to compile gstreamer 1.14.4 to take advantage of the webrtc module. I was able to successfully compile it using cerbero on my raspberry pi but I have an issue where when testing my webrtc ...
0
votes
1answer
678 views

Hardware PWM for Python 3.5 or higher?

I am developing a camera tracker to follow objects identified via OpenCV in a dedicated environment on mt Pi3. Currently the two SG90 servos are controlled by software PWM using RPi.GPIO - but the ...
1
vote
1answer
34 views

Running a Python Script with Tensorflow via systemd doesn't work, but running the same script via the terminal works

I have successfully coded a Python 3 Script that detects objects in a frame given my the camera. Based on those objects detected, I run commands and logic. I have tested this and I can run it via the ...
-1
votes
0answers
24 views

real time voice to qrcode using pyhton

How to convert audio signals to QRcode using raspberry using python.I want to record the voice using a microphone and convert it into QRcode.When I scan the QRcode the audio should be played.I have ...
0
votes
1answer
40 views

How can hide ffmpeg output?

os.system('ffmpeg -ss 00:08:00 -i '+dAdi+' -frames:v 1 /home/pi/Desktop/filmekrangoruntuleri/'+egAdi+'2.jpg') When I run my python(3) script through the terminal, I see the following outputs produced ...
1
vote
1answer
871 views

GPIO event handler triggers off rising and falling edges

I'm trying to set up a tachometer. I used a comparator IC to get a real clean signal on pin 21 but I'm getting iterrupts on the rising AND falling edges. #!/usr/bin/python3 import time import ...
1
vote
1answer
119 views

Upgrading to Latest Numpy Version on Raspberry Pi 3

I'm not sure if this is a Raspberry Pi issue, Raspbian Issue, Python Issue, or all of the above. So forgive me if this is the wrong place to ask this. I just got me a Raspberry Pi 3B+ and installed ...
1
vote
1answer
467 views

PWM object's ChangeDutyCycle method is not working

I have a motor class but I dont' know why this motor cannot change speed class Motor: def __init__(self, pos, line_status=0): def set_motor_gpio(_a, _b, _pwm): self._A = _a ...
-1
votes
0answers
44 views

Using Python smbus to communicate with Smart Battery

Getting I/O errors when using Python 3 smbus module under Raspbian to retrieve (read) data back from a laptop Smart Battery. A similar program coded in C for Arduino works perfectly with this battery. ...
0
votes
1answer
25 views

Is in Python anything like in Java platform.exit() to leave the program [closed]

I got a Button and when the Button was tapped it runs a function. Till here I got everything ready. And now my question I will close the program correct like in the title. Is in Python anything like ...
0
votes
2answers
668 views

Installing Python 2.7

I am new to the Raspberry Pi, I have a project. I would like to work on Python 2 not Python 3. By default Python 3 is installed on my Pi. I want to change or remove this version and I want to ...
0
votes
2answers
83 views

AttributeError: 'NoneType' object has no attribute 'send' pigpiod

So I create an another program that can run stepper motor clockwise and counter clockwise with a ramp up and ramp down in there and adding limiter switch on GPIO 16 and 26 to stop the pi....
0
votes
1answer
330 views

Running a camera script on startup - Raspberry Pi Zero W

I'm creating a time-lapse camera to attach to a pair of glasses. I tried out my script (python 3) and it works, but I need to get my script to work upon startup up since it will powered by a ...
0
votes
1answer
420 views

Controlling Linear Actuator

I am hoping to control a WINDYNATION 4" Stroke Length Linear Actuator with a Raspberry Pi for a senior design group project. Ideally, the program will make the actuator fully extend, and then retract ...
0
votes
2answers
21 views

Program not able to open file at start up but when running from command line, runs as expected

using a library from https://github.com/BLavery/LIBtft144 this line of code doesn't seem to run when I run the program from a systemd. I also tried calling it from a crontab call of my .py program. ...
0
votes
1answer
34 views

GPIO LED Python

I am not sure what I am doing wrong here. I found this guide on but it's not working for me. The program does not output any errors but the LED doesn't light up. I have and LED with + on GPIO 12 ...
0
votes
1answer
63 views

pigpio python serial wave output not correct

I am trying to use joan's pigpio to write a serial command on my Rpi 3 gpio 14(UART0TX).My goal is to write a command from the pi to another device. When i send the command i do not see the ...
1
vote
0answers
426 views

How can i emulate a ps/2 keyboard with raspberry pi3

So I am working on an medical machine which runs on microcontroller(So,No OS).It gets the input from ps/2 keyboard. I would like to automate it. I would like some basic idea and some help on how to do ...
-2
votes
1answer
38 views

Run a fan 5scs long GPIO

def fan_on(): GPIO.setwarnings(False) GPIO.setmode(GPIO.BCM) FAN_PIN = 23 GPIO.setup(FAN_PIN,GPIO.OUT) GPIO.output(FAN_PIN,True) This is my code to run a fan on my rpi via GPIO ...
0
votes
0answers
27 views

DC Motors Not Moving, Programming or Wiring Error?

I got a Raspberry Pi 3B, That ive hooked 4 DC motors up to (with a motor controller of course). I run the program and they do not move, i cant figure out if im missing something or wired something up ...
0
votes
1answer
42 views

cv2.line is not working in Rpi 3

model no: RPi 3 B Software: Python 3.5.3 Problem: I am using opencv 3.4 .I was trying to draw a line using function cv2.line().But it returns nothing.But the same code was working fine in my laptop ...
2
votes
2answers
9k views

How to connect MySQLdb in Python 3?

I want to connect MySQLdb with Raspberry Pi. But when running my program, I get this error: $ sudo python3 readMQ2sql.py Traceback (most recent call last): File "readMQ2sql.py", line 17, in <...
-1
votes
0answers
38 views

Flask/Apache running @app.before_first_request twice

I have my raspberry pi running flask/Apache. I have a background task that I run using multiprocessing. (I know celery does this, but I just wanted something simple). My issue is that the background ...
2
votes
1answer
3k views

How can I use OpenCV with Python 3 on a Raspberry Pi?

I have installed OpenCV and and access it with Python 2. However, I'm unable to use OpenCV with Python 3. It says "Cannot open shared object". ImportError: libQTtest.so.4: cannot open shared object ...
0
votes
1answer
48 views

Installing library to raspberry pi problems

I'm trying to install a library to my RPi 3 B, but for some reason when I try to import it in my script, it won't recognize the library. This is the library: https://github.com/widgetlords/...
0
votes
1answer
185 views

Stream Deck Using PI 2

I have a RPi2 1gb. I've recently got a touch screen for it and have decided that I actually should use it for what it was intended for. Programming! So my adventure starts here. I want to make a ...
0
votes
1answer
93 views

Reading Real-Time Temperature of Raspberry Pi in Guizero

Is there an option to display Raspberry Pi's internal temperature value to be able to display it into Guizero UI? I saw this source code on GitHub, but this only displays random float numbers in the ...
1
vote
1answer
912 views

Raspberry Pi 3B+ freezes randomly

General setup My RPi is connected to a mouse, keyboard, and monitor. My swap size is set to 1000 MB and I'm not using wifi. Problem The RPi freezes randomly, meaning the GUI is frozen, no SSH ...
-1
votes
0answers
53 views

GSM/GPRS SIM800L working in England,UK

I am from England and I am using SIM800L Module for sending the SMS. My module is not connecting with the network. I don't know what's the issue, I wanna know whether this module (SIM800L) works in ...
1
vote
2answers
78 views

crontab schedule .py file

I am attempting to run a scheduled .py file every 5 minutes with crontab but I don't think it's working. I'm following this post with the instructions: Can't run python script from cron I opened ...