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.
5,169
questions
0
votes
1
answer
65
views
gksudo is not taking full focus - python, glade
Ubuntu 18.04.6 LTS.
I got this script in python, and its uses Glade as a gui.
Here is the main file:
https://github.com/stuk88/UbuntuClearMemoryCache/blob/master/main.py
So.
The code at fault here is:
...
0
votes
0
answers
307
views
How to kill all incoming SSH connections?
I am developing a driver to remote control a Raspberry Pi over SSH. While this connection is active the RPi displays some message on it's touchscreen. So far everything works just fine.
The Raspberry ...
0
votes
1
answer
558
views
Ubuntu Struggling to run Python Script on Startup
I'm trying to run two scripts in a python project on startup in Ubuntu but it keeps having issues.
I have a Python project like the following:
pycharm
venv
date.txt
globalfunctions.py
internet.txt
...
1
vote
1
answer
7k
views
How to change the version of python from 3.8 to 2.7
I need to use Python 2.7 in order to use PneumoCaT as it only runs with Python 2.7 not higher versions. I am trying to set my Python version from 3.8 to 2.7 in Ubuntu, but I can't do it.
This is the ...
-1
votes
1
answer
1k
views
Installing MySQL-python error
I am trying to install a Python package, but every time I get an error. I looked for a solution on different webpages, but none of them solved my preoblem. I do not know if I am doing something wrong ...
1
vote
0
answers
3k
views
conda env create -f tf14.yml - ResolvePackageNotFound
I am trying to run the code from this repository https://github.com/thanard/causal-infogan. The instructions to install the python environment are as follows
Create a python environment and install ...
4
votes
1
answer
2k
views
Will apt installation of Python 3.10 break the 3.8 version?
Can I install Python 3.10 on Ubuntu 20.04 using apt without worrying that it breaks the Python 3.8?
I use Python 3.8 in many projects.
I'd run this:
sudo add-apt-repository ppa:deadsnakes/ppa
sudo apt ...
1
vote
2
answers
1k
views
Unable to install h5py in virtualenv with pip3
I'm a beginner having trouble installing h5py.
I'm using Ubuntu 18.04 and working in a virtualenv with pip3 and Python 3.6.9
I did the following installations in the virtualenv:
~$pip3 install -U ...
0
votes
1
answer
1k
views
Installing versions prior to Python 3.9 on 21.04
I've upgraded to Ubuntu 21.04 as I prefer not to use the LTS releases (i.e. have later packages). I've been working on a new codebase happily with the default Python 3.9
But for an older project that ...
0
votes
1
answer
483
views
Run python script when internet connection becomes available on Jetson Nano (Ubuntu 18.04)
I need to setup a Jetson Nano device so that a Python script is launched everytime an Internet connection is available.
So, referring to this question, I did the following:
I created the '...
0
votes
1
answer
5k
views
How to use opencv-python on WSL2 Ubuntu20.04
I have just installed a Ubuntu-20.04 on WSL2. And I installed a miniconda env with python 3.7, and then I installed opencv-python by "conda install opencv". But when I try the simplest cv2....
3
votes
4
answers
9k
views
Safely install Python 3.9 for non-root user?
(Please excuse my English)
My server's OS is Ubuntu 20.04. In Ubuntu 20.04, as we know, Python 3.8 is installed by default, and many system applications run on Python 3.8.
I additionally installed ...
1
vote
1
answer
10k
views
Problem to run "anaconda-navigator"
I was not able to run the command anaconda-navigator, so I followed the following procedure:
$ source ~/anaconda3/bin/activate root
$ anaconda-navigator
After this, Anaconda Navigator opened, but ...
2
votes
2
answers
13k
views
Poetry installation fails on Ubuntu
I am trying to install poetry the recommended way on Ubuntu 20.04.3 LTS:
curl -sSL https://raw.githubusercontent.com/python-poetry/poetry/master/get-poetry.py | python -
When I do so, it says:
...
0
votes
2
answers
550
views
No Error with Cron but does not work
I have written a simple python script that sends notifications using Pushbullet. The command works perfectly in the terminal but does not work automatically. The syslog for Cron:
Nov 29 18:33:01 ...
1
vote
1
answer
13k
views
/usr/bin/python: No module named pip error when trying to use pip
I am following the installation guide for the Tensorflow Object Detection API, which determines the following:
//From within TensorFlow/models/research/
cp object_detection/packages/tf2/setup.py .
...
0
votes
0
answers
80
views
Massive issue with Python [duplicate]
Me, being the idiot I am, deleted a few links to python. (I deleted the python3 link I think, as well as a few other write protected files) Now, whenever I make a typo in a command I get this: bash: /...
0
votes
0
answers
18
views
Pb with my computations when I use screen
I have some heavy computations to run. So, instead of running them in my computer I use the university's server by running the following command:
screen
python3.6 main.py > output.txt
The output....
4
votes
1
answer
2k
views
What is the package for pycairo in Ubuntu?
Plots, a plotting program, requires the dependency pycairo.
The Ubuntu repositories have two packages with the similar name, python3-gi-cairo and python3-cairo.
Which among these apt packages ...
1
vote
1
answer
2k
views
WSL on win11 - Permission denied running python script
I am trying to run a python script that creates a file.
when running I get :
File "/home/ashi/.pyenv/versions/3.8.5/lib/python3.8/os.py", line 223, in makedirs
mkdir(name, mode)
...
1
vote
0
answers
59
views
Extracting specific data from different tables and merging it
I would like to extract specific rows from specific columns from different tables, based on the column header. However, my knowledge seems to be too limited to solve it myself (both in command-line ...
0
votes
1
answer
330
views
Ubuntu 20.04, have broken python3, can it be fixed?
Realise this is a common problem, all my fault.
now have in /usr/bin
/usr/bin/python3 -> /python3.8 (in red)
/usr/bin/pyenve -> pyvenv-3.8 (in red)
no amount of fiddling with apt ...
-1
votes
2
answers
1k
views
Removed Python. How to repair ubuntu 20.04 OS without disturbing much of apps?
I have a Ubuntu 20.04 LTS version(I am new to Ubuntu), recently I wanted to install the latest version of python i.e. python3.10.0 but was not able to so I looked online and followed many methods but ...
-4
votes
2
answers
1k
views
Upgrade from 18.04 to 20.04 causing many failures
I upgraded Ubuntu 18.04 to 20.04 and now everything is broken. apt doesn't work.keep getting dpkg errors when trying to use it. cant install anything. nautilus and terminal doesn't work. lots of icons ...
0
votes
2
answers
745
views
Can a virus be installed just by downloading a file?
Let´s assume that I programmatically download a malicious file, e.g. using wget, and try to import in e.g. R or Python as a text file. If it fails, I delete it using rm. There is any chance that my ...
1
vote
1
answer
108
views
Unable to click ALT+TAB programmatically ubuntu 21.04
I'm trying to understand why I am no longer able to perform alt-tab and other manipulations programmatically on Ubuntu 21.04. I guess this functionality won't work at all. Did something change from a ...
1
vote
1
answer
7k
views
ImportError: No module named 'pip._vendor.packaging'
I need to get some software running on Python 3.5
I am using Ubuntu 21.10.
I get this error:
(foobar_addressbook) guettli@p15:~/foobar/projects/foobar_addressbook$ tox -e py35-django18
py35-django18 ...
0
votes
1
answer
560
views
Why am I getting the python version in my terminal?
Why my terminal is showing the python version? Also, how do I get rid of it?
I am using Ubuntu version 21.04. I changed the terminal theme and I'm using python version 3.9.5.
My ~/.bashrc contents :-
...
1
vote
2
answers
4k
views
Cannot use Python 3.10 as interpreter on Pycharm
I have python3.10 installed but I cannot set it as an interpreter.
The installation can be confirmed by calling python3.10 directly on the terminal, and with the command below:
$ ls -ls /usr/bin/...
0
votes
0
answers
60
views
Install python packages on the same network
The Scenario:
I have two computers connected to the same network.
On the second computer, I have a python package. I want to install this package on my project through my first computer using of pip ...
0
votes
1
answer
3k
views
Ubuntu 20.04: Can't install pip for python3.10
I am using Ubuntu 20.04 TLS in Windows Terminal from on Windows 10 Pro.
Ubuntu has default version of python that is 3.8, but I need 3.10, and
I can easily install it with sudo apt install python3.10 (...
7
votes
4
answers
4k
views
Segmentation fault while installing Python 3.5: ensurepip
I got a segmentation fault while trying to install Python 3.5 on Ubuntu 21.10.
$ guettli@p15:~$ pyenv install 3.5.8
Downloading Python-3.5.8.tar.xz...
-> https://www.python.org/ftp/python/3.5.8/...
0
votes
2
answers
571
views
Accidentally installed python twice
Ubuntu (18.0.4) newbie here. I ran
sudo apt install python3.10
in the terminal, only to discover, that python3 was already installed (next to the standard python 2.7). If I now search this most ...
0
votes
0
answers
63
views
How to make a setup File for a python3 application in Ubuntu?
I make a game called Pong with Python3 and Turtle.
Now I want to make a setup file so that I can share my game with others.
I watched this tutorial and tried what he does in that video but I am on ...
1
vote
1
answer
2k
views
How do I upgrade my python installation, and pip?
On my Ubuntu server, Python 3.8 and 2-something is installed.
I want to upgrade to Python 3.10, and I installed it from a ppa. But 3.8 is still installed, and pip --version shows pip 20.0.2 from /usr/...
1
vote
0
answers
30
views
How to launch a long-running Python code in a Docker container running on a remote server [duplicate]
I connect via the Visual Studio Code Remote - SSH extension to a Docker container running on a remote server. The Docker container is based on an Ubuntu image:
...# cat /etc/os-release
NAME="...
2
votes
0
answers
965
views
ModuleNotFoundError: No module named 'apt_pkg' trying to install deadsnakes repository
I want to install Python 3.10 on Ubuntu 18.04 (I'm currently on Python 3.8) from the deadsnakes repository with the following set of commands I found on the internet:
sudo add-apt-repository ppa:...
1
vote
1
answer
588
views
In Gedit, which syntax highlighting option is for Python 3.x?
Gedit has two options for syntax highlighting for Python:
Python
Python2
Is the "Python" option for:
Older versions of Python less than version 2 (ex. 1.6, 1.5, ...)
...or...
Newer ...
0
votes
2
answers
15k
views
python3.10 with numpy - ModuleNotFoundError: No module named 'numpy.core._multiarray_umath'
I'm trying to install numpy for python3.10 (not in a venv). I installed python 3.10 using
sudo apt install python3.10
pip didn't seem to be installed so I did
jeremy@jeremy-Blade:/$ python3.10 -m pip ...
1
vote
0
answers
762
views
Is there a safe way to upgrade boto3 system wide?
(I'm running Ubuntu 20.04.3 LTS)
I make daily use of awscli, which I installed with apt and it works just fine. However the version of boto3 that came with it is very old (1.9.253) by comparison to ...
0
votes
0
answers
45
views
/media has mysterious disks mounted containing imperfect copies of things like /bin and /etc
Today I accidentally removed python from my computer. I reversed some of the damage by reinstalling the purged packages according to a .log file. However, after python was removed, six mysterious ...
0
votes
3
answers
988
views
Connect to ssh and run command in 1 script
I login to ssh and run command manually and I want to script that.
For now I do :
ssh 192.168.1.5 -p 1234 and then I see [email protected]'s password: then I press enter (empty password) and then I ...
1
vote
1
answer
4k
views
apt-get upgrade does not work after updating python [duplicate]
I recently updated my python release from 3.8 to 3.10, using
sudo update-alternatives --config python3, but this seems to have caused a problem with apt somewhere. Whenever I try to run sudo apt-get ...
1
vote
1
answer
5k
views
How to make Python file run by double-clicking on it in Ubuntu 20.04?
I make a game in Python with the turtle module but I want to make it executable by double clicking on it. I follow these steps:
My Python file has #!/usr/bin/env python3 on top.
I created a file ...
-4
votes
1
answer
991
views
Errors were encountered while processing: mercurial-common
I accidentally removed python from /usr/bin as it was conflicting with /usr/local/bin. (rm -rf /usr/bin/python*)
After realising my mistake i reinstall python3.8 and python2.7 from source. Python is ...
0
votes
1
answer
629
views
Cron job doesn't run script python in the specific directory
I created a simple python script to add, commit, and push all files in some directory. I want to do this daily by a scheduled cron job. But unfortunately, the script doesn't run. Before this, I do ...
6
votes
1
answer
265
views
Firefox 94 Broke My Hot Keys
In Kubuntu 20.04, I use autokey to create hotkeys that launch websites.
Prior to Firefox 94, these hot keys had no difficulty launching pages, but now each time I try to launch a page I get this error:...
0
votes
1
answer
758
views
Error installing NS-3 in Ubuntu 21.04
I am trying to install NS-3 in my ubuntu-21.04-desktop-amd64.iso, but during the attempted installation, when I run the following command:
sudo apt-get install gir1.2-goocanvas-2.0 python-gi python-gi-...
-1
votes
1
answer
850
views
Python code works on linux, error occurs on windows(backslashes) [closed]
So I have a personal project which I know is pretty inefficient but works. I am writing a python code that executes the non pip version of tesseract(apt installed in linux). My code works on linux, ...
0
votes
1
answer
2k
views
Failed to create FSL Python environment in Ubuntu 20.4 shell in Windows 10
I need to use fslreorient2std on some images and I'm trying to install FSL in an Ubuntu 20.04.3 shell in Windows 10.
I used python "/mnt/c/Users/user/Downloads/fslinstaller.py", which seems ...