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

Questions tagged [python-2.x]

To be used when a piece of code in a question is specifically related to any version of Python 2.

Filter by
Sorted by
Tagged with
5
votes
4answers
7k views

Do we need multiple versions of Python?

I am new to Linux and going through my installed folder I can see there are four different Python folders in the directory list. python python2.7 python3 python3.2 Do we need all the four versions ...
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, ...
2
votes
1answer
32k views

Send data from Python to Arduino through serial port

Should I keep Arduino IDE and Serial 9600 open to be able to recieve data sent from python code , Arduino is connected with pi 3 with serial communication ? tried to send data while the arduino IDE ...
2
votes
1answer
842 views

Python 3 interpreter not recognizing a new installed package(python 3.5.3)

I'm new to this RPI world and also to python although I completed the basic courses I'm still getting used to this so I will appreciate your patience I'll try to express my self the best way. I ...
2
votes
1answer
348 views

How to have Python use more of my CPU?

I have a code written in Python that takes about 9% of the CPU when ran. I want it to use more so it can run faster. To solve this problem, I tried multiprocessing, however, before writing a code for ...
2
votes
2answers
311 views

Print PDF files using Python code

This Python code works in Windows but does not work in Raspbian. How do I print PDF files using the Raspberry Pi? import os fd = os.startfile("/home/pi/Desktop/a.pdf", "print")
2
votes
1answer
441 views

Using the UART GPIO pins on a pi 3 to output characters to a TI MSP430

I'm currently building a remote controlled motor driven robot that is taking USB remote input, and output said input through the UART TX pin to a Texas Instruments MSP430 launchpad, that is connected ...
2
votes
2answers
357 views

Slow Video Processing

I installed OpenCV libraries in raspberry pi for my project "Air Hockey Robot" and I'm using python for video processing. I am using PS3 eye camera for video capture at 60 fps. But it seems that video ...
2
votes
0answers
817 views

Recommended way for a python script to check NTP update status, and initiate an update if necessary?

I am writing a data logging python script and I would like it to find out if the system clock has been synchronized via NTP recently, and if not, to attempt to cause it to happen before proceeding. ...
1
vote
2answers
12k 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 ...
1
vote
3answers
2k views

Convert .xlsx to .pdf [closed]

I'm looking for a python module to convert a .xlsx excel file to .pdf. My excel file will have formatted cells and embedded images. Does any one have any recommendations?
1
vote
2answers
271 views

Launching Python code on start-up

I'm making a robot using a Raspberry Pi. I have written code for it in Python and I would like the Python script to run as soon as the Pi is powered. I only want the whole script to repeat the whole ...
1
vote
3answers
85 views

Reading time off of a cellular modem with python 2.7 and pyserial

TL;DR: I need to read the time off of my Hologram Nova USB cellular modem on /dev/ttyACM0 and update the system clock after the pi restarts. I'd like to do it in Python but it isn't reading the ...
1
vote
1answer
3k views

“ImportError: No module named 'gspread'”

I installed gspread library and ran pip install gspread and followed all the instructions on this page. I've read many other threads on this issue and have checked that no file named gspread.py exists ...
1
vote
2answers
806 views

Run two Python programs every 30 minutes

I have two Python 2.7 programs. When I boot the Raspberry Pi I want to run that programs automatically. I also want to very 30 minutes close that programs and run them again. I imagine that the best ...
1
vote
2answers
1k views

Self balancing a quadcopter using python and a gyroscope information? [closed]

I have these information: x, y from gyroscope. 1, 2, 3, 4: motors If the quadcopter is slant to front y is a positive number. If the quadcopter is slant to back y is a negative number. If the ...
1
vote
1answer
18 views

Dash/Plotly webserver not working on raspberry Pi, working on mac

I am trying to chart real time data from a Raspberry Pi to a web server. In this case I am using dash (https://dash.plot.ly/live-updates) to do this. I am currently testing my dash web browser on ...
1
vote
2answers
63 views

TSL2561 Lightsensor with Python 2.7 and rpi.gpio

I want to add a TSL2561 to an existing (Model B, Wheezy) system that is built on Python 2.7, and uses some other GPIOs (not using I2C), with the module rpi.GPIO. The TSL2561 python library has a ...
1
vote
1answer
2k views

This module can only be run on a Raspberry Pi!

I'm running daemon python file in virtualenv and has a Error: File "rpi_daemon.py", line 5, in <module> import RPIO File "/home/pi/python_virtualenv/local/lib/python2.7/site-packages/...
1
vote
1answer
129 views

same GPIO input signal on multiple raspberri's from one source

Im having 7 raspberri pi's 3 connected to 7 screens, running an python 2.7 app to download different images from google drive, every raspberry has different images. Geeqie is displaying those images ...
1
vote
0answers
25 views

Vilvaldi can't found Python

hello there fam I am using a python code to open a specific link like this using a webbrowser module code is this: webbrowser.get("vivaldi").open('http://127.0.0.1/raspi/invalid.php?error=403') but ...
1
vote
1answer
51 views

Can't use libgpod in python on Zero W

I have installed python-gpod on Raspbian lite Stretch, but can't get it to work. pi@raspberrypi:~$ uname -a Linux raspberrypi 4.14.30+ #1102 Mon Mar 26 16:20:05 BST 2018 armv6l GNU/Linux ...
1
vote
0answers
400 views

Play piano keys through Bluetooth LE and Midi

On the desktop Using my desktop Macbook I can successfully "remote-play" notes on my piano through the USB-Midi to Bluetooth adapter (Yamaha UD-BT01). First I pair the device through the Audio Midi ...
1
vote
0answers
480 views

Using UHF RF READER (VM-5GA) with raspberry Pi 3

I am having trouble with configuring the serial communication of raspberry Pi 3 with Raspbian Jessie OS. I want to connect my UHF RFID READER to my raspberry pi 3. This UHF RFID reader has already ...
1
vote
0answers
1k views

How to detect an empty stdout pipe in Python with subprocess

I'm experimenting with, or better trying to learn and understand, the subprocess modules using Python on a Raspberry Pi running Raspbain Jessie. In the code below I'm piping the Internet traffic for ...
1
vote
2answers
900 views

Doorbell GPIO to ground, randomly triggers

I'm working on making a Doorbell powered by a raspberry pi, I connected the existing wires from the button to the raspberry pi at GPIO pin 18 and the Ground Pin. I'm using the following while true ...
0
votes
1answer
1k views

cannot open shared object file: No such file or directory

Here I am trying to import 'libEpsonFiscalDriver.so' file on a Raspberry Pi using Python 2.7. Here are my steps in python: import ctypes ctypes.cdll.LoadLibrary('/home/pi/odoo/my_module/escpos/lib/...
0
votes
1answer
742 views

Best way to facilitate Pi to Pi communication with no network?

I have written two python scripts. One which drives an LED matrix and displays a message based on which argument(digits 0-5) you pass when you call the script. The script parses the number and selects ...
0
votes
1answer
917 views

“apt-get remove python” removed a ton of other stuff, RPi messed up

So I was trying to install the Python library lzma, and somehow I got to the point of removing python2.x, and I don't know why I did that. I'm tired, that probably why. I think I learned my lesson. ...
0
votes
3answers
735 views

Python script not running on boot from /etc/rc.local

I'm trying to ran python 2.7 script on boot, and did following: sudo nano /etc/rc.local Modified file before exit 0 with line: sudo /usr/bin/python /home/smart-scale/scoreboard/main.py & That ...
0
votes
1answer
1k views

Serial Communication in Raspberry pi 3 B+

I want to communicate between Raspberry pi 3 B+ and GSM GPRS A6. I tried and I am unable to send data to GPRS Module from Raspberry pi. Now, I know that GPIO serial port is disabled by default in ...
0
votes
1answer
3k views

Remotely debug python code on pi using Eclipse in windows

I am new the raspberry pi and I have just started my python development on it. I have installed eclipse in windows along with pydev. I have even made a ssh connection from eclipse to pi so now I have ...
0
votes
1answer
94 views

Cannot detect ttyS0 in python RPi3b+

I'm using the Rpi 3B+ and understand the hardware uart is used by the bluetooth. I'm OK to use the other uart I've followed several threads and believed I've done all I can. Enabled the Uart in ...
0
votes
2answers
113 views

Help running Python script from terminal as easily as I can with IDLE

I have a long script that runs several GPIO devices using both SMBus and pigpio. It starts a thread to cycle through a series of screens on an OLED display, and then connects to Paho MQTT, and keeps ...
0
votes
1answer
216 views

Cron not finding necessary files to run .py file

I hope this is not a duplicate post however I have spent about 16 hours researching a solution for my problem and have not found it yet. I am attempting to run a python GUI that acts as an interface ...
0
votes
1answer
238 views

“NameError: name 'L_R' is not defined” using GPIO.PWM inside a Class

I'm trying to create a class to define various led status using 3 leds. For some status only I need to use GPIO.output method, but in other cases I want to use GPIO.PWM method to create a blink effect ...
0
votes
2answers
2k views

Problem with python cec in raspbian stretch

I have rpi 1 model b with stretch installed. I want to use python cec library. First I tried to install it. sudo apt install python-libcec But fails to import cec :: Python 2.7.13 (default, Jan 19 ...
0
votes
1answer
3k views

How to add Rpi.Gpio to pycharm

I'm developing an application which interacts with raspberry pi.I need to get the temperature and humidity sensor readings from raspberry pi, for that I wrote this code.(I'm using python 2.7) import ...
0
votes
1answer
50 views

Run command on Pi based on ping result [closed]

I am very new to this stuff. Trying to see if anyone has accomplished what I am looking to do. I would like to have a ping to my android phone running on my Raspberry Pi. When it gets a response I ...
0
votes
0answers
7 views

Seek backwards with Python2-mpd

I installed Python2-mpd on archlinux, and would like to have an option to seek song backwards. But calling this line in Python gives me an error: client.seek(2,-30) mpd.CommandError: [2@0] {} ...
0
votes
1answer
31 views

Pigpio on callback get value

I currently have some code that I found that constantly outputs a value from a digital caliper. However, I want to modify this so that it is inside a function that can return that is returned from ...
0
votes
0answers
30 views

how to make python program executable in rpi

I have a python code which works well in raspberry on boot. I need to hide the code and make the user to non editable. The program have a kivy ingerface and the program starts on start up. Even though ...
0
votes
0answers
53 views

capturing video stream using piCam

i'm trying to capture the video stream using piCam. but i get this warning and the execution stops this the code: this the code I used: import numpy as np import cv2 cap = cv2.VideoCapture(0) cap....
0
votes
0answers
32 views

rasberrypi gui using python 2.7

I'm trying to host run a GUI program on my pi using ssh. but I get this error: App(Tkinter.Tk(), "window name") NameError: name 'Tkinter' is not defined. however when I type "import Tkinter" in pi ...
0
votes
0answers
243 views

Read registers of Power Meter w/ RPi using Pymodbus TCP

I'm trying to monitor the power usage of multiple devices and store that data in a database using Python. I am connecting my RPi 3 to the power meter via an Ethernet cable and using Modbus TCP. To use ...
0
votes
0answers
203 views

Error: could not locate runnable browser

I am using Raspberry Pi3 B+, I have a problem with webbrowser module, when i run my Python 2 Program Code: import webbrowser url = "youtube.com" chrome_path = "/home/pi/Desktop/Chromium Web Browser" ...
0
votes
0answers
281 views

Cannot install install tensor flow on raspberry pi 3b

i am running into an error when i try to install tensor flow using pip on my raspberry pi 3b+. here is the error message: Command "/usr/bin/python -u -c "import setuptools, tokenize;__file__='/tmp/...
0
votes
1answer
81 views

Adafruit_Nokia_LCD module on Raspberry Pi Zero W

I'm stuck with this Adafruit module. I was able to install without errors on a Pi2, but when I tried to replicate on my Zero W the installation goes fine but then I cannot import the module ("...
0
votes
1answer
2k views

Problem installing pynput module for python 2

I am having issues installing one python 2 module (pynput). In fact I typed the command: sudo pip install pynput It works when I try the following snippet: import pynput but when I type: from ...
0
votes
1answer
36 views

SSH showing “connection failed” after installing “pip”

Python3, pip3 and python was installed before on my Raspberry Pi. Today I've successfully installed pip using below command: sudo apt-get install python-pip After few hours later I'm not able to ...