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
0answers
502 views

Raspberry Pi + Mcp2515

I used Raspberry Pi + Mcp2515 with CAN bus. In my code, When I lost request it will locked,then GUI will not working. msg = can.Message(arbitration_id=0x000601, data=point, extended_id=false) bus....
0
votes
1answer
297 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 ...
3
votes
2answers
7k views

Pip3 install throwing error on raspberry pi 3 Raspbian-Jessie

I am trying to install a python 3 library on a raspberry pi 3 running Raspbian-Jessie. sudo pip3 install LIBRARY However, regardless of what library I try to install, I am getting this error: ...
1
vote
5answers
12k views

How do I connect GSM SIM 900A to a Raspberry Pi 3?

I want to connect the GSM SIM 900A to a Raspberry Pi 3 but I don't where the problem is. I used this configuration: https://qph.fs.quoracdn.net/main-qimg-c124f9e741afd438969e869e52d0df6b Then I ...
1
vote
1answer
3k views

Scan and Retrieve List of Bluetooth Devices Using Python 3

When using the terminal inside the Raspberry pi, i have to use only 3 commands to retrieve a list of Bluetooth capable devices in the area. These are the commands that are executed in order: "sudo ...
0
votes
2answers
134 views

How can I add a delay before raspberry pi cam starts recording?

I am using the following command to take video: os.popen('raspivid -1 640 -h480 -fps 25 -o motionCapture/' + timeStamp + '_motion,h264 -t ' + str(timeInSeconds * 1000)) The problem is when I try to ...
1
vote
1answer
1k 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 ...
1
vote
0answers
125 views

Python 3 Debugging Symbols for Raspbian Stretch

I am trying to track down a segfault when using Pip on my Raspberry Pi Model 3B running Raspbian Stretch. I've configured the pi to do a core dump, and I've gotten gdb to load the core. The ...
0
votes
0answers
65 views

How to Start program when Pi boots up

I am making a system, in which I need to be able to make the pi autologin and run a python3 script without a monitor or password. The script requires human input from a keyboard, but it doesn't work ...
0
votes
0answers
74 views

Raspberry Pi 3 with Microstack GPS (latest GPS data)

I implemented the following code: gps = microstacknode.hardware.gps.l80gps.L80GPS() while True: data = gps.get_gprmc() print(data.keys(), data.values()) time.sleep(1) After some time it ...
0
votes
2answers
143 views

Raspberry Pi surveillance camera

I am working with a surveillance camera project with a motion sensor and a buzzer on Raspberry Pi, but when I run the code below: from gpiozero import MotionSensor from gpiozero import Buzzer from ...
0
votes
1answer
411 views

How to reinstall python3 from binaries?

One of my RPis has a problem with python3: root@sent121:~# python3 Segmentation fault When debugging a print('hello') script I get root@sent121:~# dbg python3 -bash: dbg: command not found root@...
1
vote
0answers
40 views

Raspbian Python Package installtion errors, Parselmouth

I am trying to install this package, praat-parselmouth, however the installation does not move forward after getting stuck at either "Running setup.py bdist_wheel for praat-parselmouth" or if ...
1
vote
0answers
164 views

Time.sleep() zeroes photo resistor readings on Raspberry Pi [closed]

I have a Raspberry Pi 3 and a photoresistor, LEDs, resistors, breadboard etc. Now, I have observed a strange occurrence. When I run the following code all of the readings from the light sensor are ...
0
votes
1answer
51 views

Help combining two scripts [closed]

I know this is very blatant but I really need help with my python scripts right now. I have following two scripts or one script and a class if you will so. import sys import time import pigpio ...
0
votes
1answer
1k 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
181 views

Problem with packages [closed]

I'm trying to compile my code import sys,os sys.path.insert(0, '/usr/include') sys.path.append('/usr/include') import plivo, plivoxml auth_id = "Your AUTH_ID" auth_token = "Your ...
0
votes
1answer
919 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 ...
3
votes
3answers
2k views

Is it ok to remove all Python?

I have a Raspberry Pi 3 Model B and I installed Raspbian on it using NOOBS. I want to use Python 3.6 only. Is it ok if I uninstall both Python 3.5 and 2.7? Will there be no system problems? If I yes, ...
1
vote
0answers
564 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 ...
1
vote
2answers
1k views

WiFi Interfacing using Python

I am building a Smart Mirror for a school project and I need a way to give the user an interface where they can search and connect to a network. Unfortunately, my Raspberry Pi stopped working (doesn’...
1
vote
0answers
332 views

Block Raspberry Pi from quitting fbi fullscreen (HDMI) to command line

I'm developing a parking control system in Python 3 which runs in headless mode at the Raspberry Pi startup and uses one RFID reader, one Barcode reader and many other devices but they really don't ...
3
votes
3answers
15k 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
vote
3answers
1k views

UART problem: Sending more than 8 bits

How can I send something more than 8 bits over UART? Any python libraries?
1
vote
2answers
3k views

Recording time series data from Bluetooth by Pybluez

I am currently work in a project that I am using Raspberry-pi to record data from Bluetooth signal. I chosen the PyBluez to program bluetooth. My object is to write the data into csv file, each data ...
5
votes
1answer
8k views

Python script fails with 'ImportError' when run from rc.local

So I've tested that my script does attempt to run and I'm recording the error message of Traceback (most recent call last): File "/home/pi/steamFriendStatus_v0.3.py", line 6, in <module> ...
-1
votes
1answer
119 views

Python urllib won't work from ~/.bashrc

I have the following code in a file called ~/foo.py: import urllib.request url = "https://raspberrypi.stackexchange.com" req = urllib.request.Request(url) resp = urllib.request.urlopen(req) It runs ...
1
vote
1answer
219 views

How to open .bat file in VSCode using raspbian

From the website ( https://channel9.msdn.com/Blogs/jsturtevant/Setting-up-Project-Oxford-for-Python-on-Windows ) at about 4:27, the author opens the activate.bat file by using code .env\Scripts\...
1
vote
1answer
863 views

Cannot import patterns; workaround doesnt work either

Aim: Build projectoxford into raspberrypi3 - https://channel9.msdn.com/Blogs/jsturtevant/Setting-up-Project-Oxford-for-Python-on-Windows I have reached the steps of: pi@raspberrypi:~/happy-image-...
3
votes
2answers
2k views

How to generate accurate PWM signals for many servos

I've ran into a bit of an issue with the Raspberry Pi's ability to generate accurate PWM signals for servos. My problem with this is that the servos jitter because of this lack of accuracy. Is there ...
1
vote
1answer
405 views

python.exe file not found; creating “virtual environment”

Aim: Build projectoxford into raspberrypi3 - https://channel9.msdn.com/Blogs/jsturtevant/Setting-up-Project-Oxford-for-Python-on-Windows At 2:11 of the video, for windows, the command used to create ...
1
vote
1answer
1k 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 ...
2
votes
1answer
2k views

Found a PyPi Package for Opencv-contrib, but can't install using pip

I'm trying to install OpenCV for python with extra modules on my raspberry pi. The OpenCV website has a set of instructions that I have tried with different variations for the past several months. I ...
-1
votes
1answer
284 views

Sending data from html to python [closed]

I'm doing a project called IoT based announcement system where the user has to type the lcd number and the information to be announced in a webpage and that data should be printed and also converted ...
-2
votes
1answer
263 views

How to blink led on Raspberry Pi

I wrote python program that can be blink led on raspberry pi . import RPi.GPIO as GPIO ## Import GPIO library import time ## import Delay library GPIO.setmode(GPIO.BOARD) GPIO....
2
votes
2answers
1k 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 ...
0
votes
2answers
261 views

Wireless data streaming with Rasbperry Pi 3

What is the simplest way to stream sensor data obtained by a Raspberry Pi 3 to my laptop? I have my Pi reading data from a gyroscope and I'm wanting to plot the data on my laptop as it is received (...
2
votes
0answers
688 views

Enabling I2C resulting in error Raspberry Pi

I am trying to use MPU 6050 on raspberry pi. For that I enabled i2c on raspi. But after that whenever I am trying to check the modules on my Python 3 or 2 shell for e.g. when I run help('modules'), I ...
0
votes
1answer
374 views

Ultrasonic sensor stops working after some time RaspberryPi

I have used the ultrasonic sensor with Arduino successfully without any problems in the past. However, with Raspberry pi, it is not very consistent. It stops working after some time. I have have read ...
0
votes
0answers
254 views

Not able to use GPS in Raspberry Pi3 [duplicate]

The image shows the error when running the following code. import serial #import serial pacakge from time import sleep import webbrowser import sys def GPS_Info(): ...
1
vote
0answers
385 views

I keep running into missing elements with GStreamer

I have tried uninstalling and reinstalling GStreamer on the Raspberry Pi 3 and I keep finding that I have missing elements. This is the Pi on Log Level 4 (GStreamer): This is my laptop, running ...
0
votes
1answer
69 views

Python 3.4.2 progressbar2 issue

The Pi was originally installed with Python 2.7 To install python 3.4.2, I did the following: sudo apt install python3; mkdir ~/bin; ln -s /usr/bin/python3 ~/bin/python which Python: /home/pi/bin/...
0
votes
2answers
2k views

How to start a python3 script on startup without login? (stretch image) [closed]

I am trying to start a python script called "irremote.py" on startup (currently in my home directory). I am running raspbian-stretch on a Pi Zero W, and I would like the script to start without a ...
4
votes
2answers
9k views

I can't download PyCharm for Raspberry Pi 3

I have had my raspberry Pi 3b for a few months so I'm just getting used to it. I would however want to install PyCharm because I want to use my Pi to program on rather than my PC. Any ideas would be ...
2
votes
0answers
2k views

Segmentation fault, running out of memory? PyQt5

I am programming code to display camera feed with my raspberry pi 3 and Raspbian. Strangely, sometimes the code shows the video and sometimes i get the Segmentation fault error. I used gdb to find ...
1
vote
2answers
5k views

Jessie: libEGL warning: DRI2: failed to authenticate

I'm developing an application using Python 3 / PyQt5. Everything seems ship-shape until I try to run the GUI (which is partially reliant on a live graph that is backed by pyqtgraph) on my Raspberry Pi ...
-2
votes
2answers
108 views

Syntax Error in python code for read sensor data through url and store into drive in .csv format

I was writing a python script to collect data remotely from plc through URL and store those data into my drive in CSV format. I have used the urllib3 module to collect data from the remote device. The ...
1
vote
1answer
768 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 ...
0
votes
1answer
1k views

RuntimeError: No access to /dev/mem

I'm using the PXfmini with the raspberrypi3 for a project and I need to use mavros and python code. My operative system is Frambuesa. I created the catkin workspace and I tested the c++ file ...
1
vote
1answer
3k views

Problem with matplotlib

I am attempting to run some matplotlib tutorials on my Pi3 running Raspbian Stretch. I have installed matplotlib & numpy using pip3 When trying to run any of the tutorials I get an error ...