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
3answers
228 views

Crontab suddenly doesn't start jobs

I'm suddenly having crontab issues, I didn't do anything other than change the script names and then change them in crontab as well so they all natch, the scripts work if I start them manually, so i'm ...
0
votes
0answers
31 views

Python keyboard package not responding through VNC

I have a simple python program that responds to keyboard presses using the package keyboard: import keyboard import time def catch_key( event ): print( "Key pressed:" + event.name ) def propel()...
0
votes
1answer
477 views

Import Error: No module named watson_developer_cloud

I'm trying to create a program that will send an image to the IBM Watson studio and use that to perform a computer vision image recognition analysis. Anyways, when I try to run the program, it only ...
1
vote
1answer
113 views

I need a lightweight CLI Linux Distro that can support Python

I have a spare raspberry pi, I figured i'd use it for a python releated task, is there a cut down Linux Distro that does not include a GUI but only a CLI that can also fully support running python ...
0
votes
1answer
407 views

Servo robot with keyboard control

I am currently creating a design project that involves controlling several servo motors for a raspberry pi 3. I want to use a keyboard to control the direction of the motors, and I am using curses to ...
0
votes
0answers
22 views

webserver to use if web app have both internet and non-internet dependent tasks

I was working on an application where i have two tasks and which are interdependent Fetch some data from external server. Even if the internet gets disconnected can the same webpage call my flask ...
0
votes
1answer
69 views

Generating signals with Pi

I have a vector of 500 numbers and would like to output these at a sample rate of 1kHz, thus a signal time of 0.5seconds. Is there any way to do this using a Pi? Do the GPIO pins only allow for an On/...
0
votes
0answers
110 views

Raspberry Pi shows 100% CPU usage then crashes when I run a python script

Hi I've been working an opencv and python project which the raspi should detect and recognize a face and detect a motion. It works fine with my laptop but after I run it on my raspi the raspi crashes. ...
0
votes
1answer
370 views

Multithreading Python Raspberry Pi 3 B+

My Raspberry Pi 3 b+ is reading by Modbus the values of an irradiation sensor, processing all the data, showing it in a plot and showing some warnings (if the irradiation ramp is higher than 5%). I ...
1
vote
1answer
163 views

Access wpa_supplicant inside docker

How can I access wpa_cli inside a docker? I want to connect to wifi from inside a docker in Pi 3. For that I am using wpa_cli. But when I run wpa_cli inside the docker I get following error: Could ...
0
votes
1answer
62 views

Serial read from arduino not working properly

I am trying to read analog read from ardunio connected to my raspberry pi. Following are my raspberry pi and arduino codes. Raspbery pi: import time import serial ser = serial.Serial('/dev/ttyACM0'...
1
vote
1answer
84 views

Accessing a Virtual Environment from IDLE3 shell?

On my pi3 I have created a virtual environment with Python3. I run my pi headless, using my Windows 10 PC. I access the pi with 3 apps: - PuTTY for terminal usage; - WinSCP for a file Explorer; and ...
0
votes
1answer
43 views

Python program issue run at bootup, just work one time [closed]

I have some problem on Rpi3. I work for kiosk program. I created python script. If rpi connect to internet, chrome shows page from internet but if there is not internet connection on pi, chrome shows ...
0
votes
0answers
30 views

gpiozero ImportError in virtual environment

I've been trying to use the gpiozero library lately with one of my opencv projects. Installed gpiozero using pip. Sample code works fine, no issues. The problem is, my opencv installation is in a ...
0
votes
0answers
614 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 ...
-1
votes
1answer
40 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
102 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
225 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
0answers
190 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
51 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
230 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 ...
0
votes
0answers
28 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
2answers
363 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
40 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 ...
1
vote
0answers
179 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 ...
2
votes
1answer
232 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
617 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 ...
1
vote
1answer
232 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 ...
0
votes
0answers
90 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 ...
0
votes
1answer
213 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
30 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 ...
2
votes
1answer
894 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 ...
0
votes
2answers
344 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
2answers
27 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
46 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 ...
-2
votes
1answer
39 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
178 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 ...
0
votes
1answer
220 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 ...
0
votes
1answer
111 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
272 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 ...
0
votes
1answer
957 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 ...
1
vote
0answers
93 views

Pi-3, Model B, SenseHat - How can I restart my code while it's active.?

I am new with python and PI. I have been looking all over for information about this but with no luck. currently it works like this: I start the program, I press the button and then it starts counting ...
0
votes
1answer
82 views

Tkinterhtml fails to run on raspbian. Python 3.7

Tkinterhtml fails to run on Raspbian. Python 3.7 _tkinter.TclError: couldn't load file "/usr/local/lib/python3.7/site-packages/tkinterhtml/tkhtml/Linux/32-bit/Tkhtml/libTkhtml3.0.so": /usr/local/lib/...
0
votes
2answers
123 views

Is it possible to find the current sampling rate of MCP3008? [closed]

I am using MCP3008 with Raspberrypi Model B. MCP3008 is sampling the analog signal. But is there any way through which I can verify if it is correct or not. For example, I need a sampling rate of 1.5 ...
1
vote
2answers
105 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 ...
1
vote
2answers
916 views

open a terminal on boot and auto-run a looping python script

When my RPI3 is booted, I would like it to automatically have the terminal open with my python script already running. Note that it loops endlessly. I want to open the terminal so I check the output ...
1
vote
1answer
369 views

Python script not running when added to crontab

I have an on_reboot.sh file that contains the following: #!/bin/bash source /home/pi/.profile workon cv cd /home/pi/reboot python pi_test.py After that I made the file executable using $ chmod +x ...
3
votes
1answer
4k views

How to fix Remote I/O Error Whilst Using i2c OLED

I was using my i2c OLED perfectly well when seemingly for no reason I started getting the Remote I/O Error when I ran my Python program. For some reason this was fixed by installing i2c tools again. ...
0
votes
1answer
84 views

Picamera (in Terminal and Python 3) just does nothing

I have a Picamera V2, a brand new Flex Cable (so that's not the problem) and a Pi 3B. I am using VNC from Ubuntu. The Pi connects OK. But in the terminal (raspistill - o hi.jpg) and in Python 3 ( ...
-1
votes
1answer
44 views

python basic problem in developing raspberry pi 3 GPIO skill

this is a part of a code for picroft skill: def handle_command_intent(self, message): if message.data["command"].upper() == "BLINK": self.speak_dialog("ledblink") the "data" and "...