Questions tagged [python]

Python is an interpreted programming language that is often, but not solely, used as a scripting language. A version of Python is included by default on all Ubuntu distributions.

Filter by
Sorted by
Tagged with
3 votes
2 answers
22k views

Return Value to Python script from shell

I'm trying to return a string from shell script to python getting the below error. ./whiptail.sh: 10: return: Illegal number: uuiiu i tried running the whiptail command within python directly using ...
muthu kumar's user avatar
1 vote
0 answers
129 views

cross compile python programs and programs containing ROS libraries for arm

I have been trying to cross-compile python programs and programs containing ROS libraries for ATSAMA5D27 SOM1 EK1. I haven't found the suitable toolchain so far. I compiled a C program using ...
arjun sahajan's user avatar
2 votes
1 answer
4k views

Running a python script for different files in subdirectories

I have a main folder named "simulations". In this folder I have 250 different folders named with year-month-day as: "19902010" "20040512" etc... These dates are random without any specific pattern but ...
Silvia Massaro's user avatar
0 votes
0 answers
33 views

I have installed 18.04 but python2 did not come with it

I am kind of new in linux environment, I had a 18.10 and I overwrite a 18.04 on it. Now I have a fresh installation of 18.04. Before installing anything, I have checked by typing python to terminal, ...
muyustan's user avatar
  • 268
0 votes
1 answer
160 views

Xubuntu 19.10 Software & Updates app does not work when Python 3.8 is set as default version

I'm using Xubuntu 19.10 with default Python 3 version 3.7.x and I installed python3.8 from ppa:deadsnakes/ppa. When python3.8 is configured as default version via update-alternatives Xubuntu graphical ...
bobeff's user avatar
  • 431
0 votes
1 answer
2k views

How to launch a python GUI application from crontab or rc.local?

It needs to be run as root to work properly. I've tried: DISPLAY=:0 /usr/bin/gtk-launch myapp DISPLAY=:0 /usr/bin/python /my/application/gui.py The second line is basically what's inside of the ...
J. Blumberg's user avatar
3 votes
6 answers
6k views

Cannot connect to the Internet after removing python3 from Xubuntu

I'm using Xubuntu 19.10 and after installing Python 3.8.1 from ppa:deadsnakes/ppa, I decided that the installed by default python 3.7.5 is no longer needed and I did sudo apt remove --purge python3.7 -...
bobeff's user avatar
  • 431
0 votes
0 answers
71 views

How to get list of .so that python script use?

For example I run python3 my_script.py, my_script.py uses tensorflow package inside, that use cuda libs, how can I get list of .so libs that are loaded at script execution? UPDATE: strace -e trace=...
mrgloom's user avatar
  • 880
0 votes
1 answer
9k views

Python showing No module named 'pynput' even though installed

I have installed pynput module. But when I do import pynput , it shows the error given in the title. Here is the screenshot, showing successful installation of pynput module
Vaibhav Madan's user avatar
2 votes
3 answers
2k views

sh: 1: program not found occurs when running a Terminal command via Python, but directly entering the command in the Terminal works fine

I am experiencing a very strange problem. I made a website and I am having a problem with the backend. It's running on an Ubuntu 18.04 server. The backend is written in Python and Flask (a micro web ...
TheAudiophile's user avatar
0 votes
1 answer
262 views

Virtual Machine with Uvitools Problem

I would like to ask you something. I need to create a VM machine with Ubuntu Bionic because there is a software that I need to test but it is just works in Ubuntu Bionic and I don't want to change my ...
Jairo Mejia's user avatar
0 votes
1 answer
898 views

Run python Script that reruns every 4 hours at system startup [duplicate]

I am fairly new to ubuntu/linux and python so I beg forgiveness in advance. I have a small python script that I typically start in a terminal screen. This script runs a simple task then sets a timer ...
MikeSmol's user avatar
0 votes
1 answer
2k views

Should I remove python3.6 since I have python3.7 [closed]

Ubuntu version is 18.10 First of all, I am new to linux(ubuntu) as well as python world. From my understanding I currently have python2.7, python3.6 and also python3.7. I have read that I should ...
muyustan's user avatar
  • 268
2 votes
2 answers
3k views

ImportError: cannot import name GUdev, introspection typelib not found

Can anyone suggest how I fix up the errors from standard application of Kazam screenshot app: alistair@alsE590:~$ kazam /usr/bin/kazam:77: DeprecationWarning: dist() and linux_distribution() ...
bigal's user avatar
  • 31
0 votes
0 answers
982 views

How to upgrade dpkg to python 3.8

I have Ubuntu 16.04. Recently I upgraded python from 3.5 to 3.8. Now, whenever I try to install something, using apt, I get the following error: Setting up python3.5 (3.5.2-2ubuntu0~16.04.9) ... /var/...
Erel Segal-Halevi's user avatar
1 vote
0 answers
39 views

16.04: Terminal doesn't open by clicking on icon, ctrl-alt-t, or gnome-terminal in xterm [duplicate]

Hi I am a beginner in using Ubuntu (16.04) and I recently installed new libraries for python3 Tensorflow, pandas, and a couple others. However, I lost the ability to open terminal using Ctrl+Alt+T, ...
LeviFaraday's user avatar
2 votes
2 answers
4k views

Why does a Python program I write in Windows not work in Linux? [closed]

I wrote a python program in windows, then used pyinstaller to make it an .exe file. but the python program won't work in linux. why?
wtb's user avatar
  • 21
1 vote
0 answers
1k views

Shell script working on terminal but not on cron

I am using jupyter notebook on virtual environment to extract data using selenium. I have used a shell script to run the jupyter notebook on cronjob as recommended. #!/bin/bash /home/username/...
user11593389's user avatar
0 votes
1 answer
1k views

python3.8 youtube-dl

I installed python3.8 in ubuntu 18.04 by compiling. if I run youtube-dl it says cannot find python. if I cat youtube-dl the shebang line is #!/usr/bin/python3 at terminal prompt python3 does get ...
Mohan Phatak's user avatar
1 vote
1 answer
284 views

Software sources is not opening

Here is the terminal output. software-properties-gtk Traceback (most recent call last): File "/usr/lib/python3/dist-packages/dbus/bus.py", line 177, in activate_name_owner return self....
Jay Michael Johnston's user avatar
-1 votes
1 answer
573 views

How i solve this error?

My Code is import numpy as np import cv2 as cv img = cv.imread('img.jpg',0) cv.imshow('image',img) cv.waitKey(0) cv.destroyAllWindows() And the error is Traceback (most recent call last): File "...
Ujjwal Kar's user avatar
2 votes
3 answers
2k views

Copy over a large number of files with new names

I have a large number of files (tens of thousands) I need to copy over from /dir1 to /dir2 but the name of the file must change as such: OLD NAME ---> NEW NAME filename.txt ---> bob_filename_1253....
Javier's user avatar
  • 21
-1 votes
1 answer
1k views

Read file in a new terminal with 'gnome-terminal --'

I want to automatize some processes for my work, so i wrighting python script to do that. I want to read file data in a new terminal, so i have a function on my python script: os.chdir("/home/andrej/...
Andrej Vilenskij's user avatar
2 votes
1 answer
3k views

ModuleNotFoundError: No module named 'glib' in Python3

I am getting a ModuleNotFoundError every time I try to import glib with Python3. I tried importing it with Python2 and there was no problem. My Python3 version is Python 3.7.5 and default Python ...
Flora Biletsiou's user avatar
-2 votes
1 answer
4k views

AttributeError: 'tuple' object has no attribute 'data_dir' [closed]

I am developing this program on python and I keep getting this error AttributeError Traceback (most recent call last) <ipython-input-17-334b6c50bab3> in <module&...
Jeremy Ng's user avatar
0 votes
1 answer
436 views

dpkg: warning: old system76-driver package pre-removal script subprocess returned error exit status 134

My computer lost power and something with apt broke (maybe python related) originally I could not even sudo apt update but I got pretty far compared to that but now it fails when trying to install ...
Richard's user avatar
1 vote
1 answer
125 views

Own Python app + other apps makes system freeze - where to start searching for issues?

I wrote a long-running (hours/days) app in Python which takes 100% CPU on one core and around 1GB of RAM - as intended. (load at around 1 according to htop) Usually, I don't use the Kubuntu 19.04 HP ...
Chris's user avatar
  • 173
0 votes
0 answers
411 views

broken package error while trying to install Python 3.7 on Ubuntu 18.04

I got this error of broken packages, how do I fix this? Conflicts: libghc-yi-frontend-pango-prof:i386 but 0.13.7-1build3 is to be installed libghc-yi-frontend-pango-prof:i386 : Conflicts: libghc-yi-...
Lewikeezy's user avatar
0 votes
0 answers
2k views

python: can't open file 'scripts/mk_make.py': [Errno 2] No such file or directory

I am trying to run Oyente tool using the commands mentioned in How to use Oyente, a smart contract security analyzer — Solidity Tutorial. I am executing the following command on Ubuntu 18.04 and get ...
user2994783's user avatar
1 vote
1 answer
916 views

Computer is always frozen while running massive Python programs

The machine: ASUS ROG STRIX X399-E GAMING ACPI BIOS Revision 1002 CPU: AMD Ryzen Threadripper 2920X 12 core processor, clock: 4000MHz Memory: (Got by free -h) 125GB vm.swappiness = 60 (Got by sudo ...
Weijie Sun's user avatar
0 votes
1 answer
2k views

ERROR: Package 'web3' requires a different Python: 2.7.15 not in '>=3.5.3,<4'

I am using the following link to install Oyente tool I have got Python 3.6.9 installed on my Ubuntu 18.04/. When I am running the command pip2, I am getting error messages: zulfi@lc2530hz:~$ ...
user2994783's user avatar
0 votes
0 answers
1k views

JAVA_HOME exporting issue while installing jep through pip3

I am trying to install jep system-wide from pip3 by the following command sudo pip3 install jep I get the following error: Complete output from command python setup.py egg_info: Error: ...
skad00sh's user avatar
0 votes
0 answers
2k views

trying run spyder on ubuntu Os on WSL

trying run spyder on ubuntu OS but getting this error: (venv) ankur@W0226983:~$ spyder QStandardPaths: XDG_RUNTIME_DIR not set, defaulting to '/tmp/runtime-ankur' qt.qpa.screen: QXcbConnection: Could ...
ankur kumar's user avatar
0 votes
0 answers
179 views

Installing python3.5

I am using Ubuntu 18.04. I checked the following link:installing python3.5 I am trying to install python3.5. $python --version Python 2.7.15+ (envsp) @lc2530hz:~ When I used the command to add ...
user2994783's user avatar
0 votes
0 answers
112 views

Can't Access Terminal

I was clumsily trying to update python on my system. My terminal will no longer open, although I'm thankfully still able to use xterm. I say clumsily because I was trying to set python for my user ...
Shaun Overton's user avatar
1 vote
1 answer
28k views

Problem with: source env/bin/activate

I am using ubuntu 18.04. I am trying to run Oyente tool for which I have to use Python. I found the following link: How to use Oyente... I am getting error at the following command: @lc2530hz:~$ ...
user2994783's user avatar
0 votes
1 answer
150 views

Allow traffic on Ubuntu Server 19.10

I've installed Ubuntu Server 19.10 on my Raspberry Pi 3B, but I've an issue with a Python script. This script starts an http server on a specific port and I can launch a comand from outside network. ...
Simone Sessa's user avatar
5 votes
1 answer
11k views

Python3 GTK module gi not found

I followed the installation guide from: https://pygobject.readthedocs.io/en/latest/getting_started.html Then I tested the tutorial with "2.1. Simple Example" https://python-gtk-3-tutorial....
Schuetti's user avatar
-3 votes
1 answer
6k views

How to stop Python while running?

I'm going to the programming competition and I need help. How do I stop a program while code is running? I tried the sys. exit () or only exit () but it doesn't work as I imagined. Here's the ...
Aleksa Radovic's user avatar
1 vote
2 answers
5k views

Start python script with keyboard shortcut

I want to start this script with a keyboard shortcut. But no luck and I have tried "everything". https://github.com/cas--/PasteImg/blob/master/pasteimg My best guess is: /usr/bin/python ~/pasteimg/...
caliph's user avatar
  • 145
1 vote
1 answer
230 views

Ubuntu 16: Confusion regarding Python 2.7 and Python 3.x

I have gone through the related questions and their answers. Still I am asking this question. If a change the alias to Python 3.x, will the system break. There are two pip files in\usr\bin directory. ...
Sreekumar R's user avatar
0 votes
0 answers
159 views

"Official" source channel to apt install a version of Python3

My background is more on Windows and Mac, and much less on Ubuntu. Recently I need to write a script to install Python3.7 on a remote machine that runs Ubuntu 16.04. The related line of the script is ...
aafulei's user avatar
  • 101
0 votes
1 answer
77 views

Fresh Install Ubuntu18.04

Hey guys sorry to bother y'all but this will be a quick and easy answer for all you linux guru's out there. I just did a fresh install and upgrade of ubuntu and noticed that python3, python3.6, ...
Snxw's user avatar
  • 69
0 votes
0 answers
54 views

Restore system after accidentally purging python2

My brother have purged python2 in his Ubuntu Desktop 18.04. That's what happened, Graphical Display Manager is failing. After logging in tty, I have tried to update, --fix-missing and apt install ...
Arafat Hasan's user avatar
0 votes
1 answer
94 views

UnicodeEncodeError when attempting to create a RAID-1 Ubuntu Server

I'm attempting to create a home NAS(Plex) using Ubuntu. I have two 8tb Seagate Ironwolf drives I'll be using in RAID-1 for the storage portion and I've also got a random 500gb drive that'll be used ...
KickN's user avatar
  • 101
0 votes
1 answer
1k views

Error on Executing python3

I have executed this command sudo rm /usr/bin/python3 sudo ln -s python3.5 /usr/bin/python3 and after this when I start executing the command python3 I got this error Failed to import the site ...
Sathiyakugan's user avatar
1 vote
0 answers
66 views

Can't start terminal after some problems with python installation

I am using GNOME, so its terminal depends on python. I messed it up, so now I can't run terminal (but I can use xterm). I changed links to python a bit, so now python's links works fine (hope so): ...
Timofey Kargin's user avatar
2 votes
0 answers
7k views

python: /lib/x86_64-linux-gnu/libc.so.6: version `GLIBC_2.25' not found (required by python) from specific dir, but not from a copy of it

I have 2 repositories. In both I'm running a similar command (in Python's multiprocess, with 2 seconds sleep between). The command is a python script I have, and I'm running it via each repo's ...
CIsForCookies's user avatar
0 votes
0 answers
1k views

Trying to run a python script using screen and venv

I’m very very new to this. I have never used ubuntu before yesterday. I purchased a droplet through digital ocean and I setup the server. I installed python and all of the needed libraries for the ...
Bubbs 's user avatar
-1 votes
1 answer
6k views

How to Set Up Nginx Permission In /root Directory?

I Want To Deploy Flask Application On Ubuntu Server With Nginx And Gunicorn. I followed This Tutorial. 1).So Every Thing Is Good Up To Gunicorn Configuration. 2). I Creates /etc/systemd/system/...
Developer Satish's user avatar

1
26 27
28
29 30
104