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
2 votes
1 answer
341 views

Python version ambiguity on ubuntu 18.04 & ubuntu 20.04

I can't comprehend what mess I am in, somebody please explain what is happening here and how do I resolve it?screenshot of command line $ python --version Python 3.6.5 $ which python /usr/bin/python ...
0 votes
1 answer
3k views

After pip successful install: ModuleNotFoundError

I'll go directly to the point. I used pip3 install Pyside2 And get this, Requirement already satisfied: Pyside2 in /home/foobar/.local/lib/python3.7/site-packages (5.14.2) Requirement already ...
-1 votes
2 answers
108 views

How to sort list of numbers into categories with specific cutoff?

anybody can help with the way how to sort my numbers in different categories: 3.83 3.93 3.48 2.96 3.66 2.79 3.17 I want to find the way how to return the number of appearances, something like: 1.5-...
0 votes
0 answers
809 views

Install python-docx for python 3.5

I use python 3.5 and I need to install python-docx package as documentation says, I use command: pip install python-docx, it says installation done successfully Though, when I try import docx it ...
2 votes
1 answer
457 views

Can I run a python package with snap on Ubuntu Core?

I wrote a python package on a Debian-machine that I am trying to port over to Ubuntu Core (it comes preloaded on the hardware I want to use). On Debian, I was able to simply pull my code from git and ...
2 votes
1 answer
524 views

Python rpi.GPIO with Snapcraft / snap?

I'm having great trouble trying to build a snap for a simple python code for Rpi2. Code I would like to put into a Snap is: # External module imports import RPi.GPIO as GPIO import time print("...
5 votes
1 answer
816 views

Snapcraft Python2 building numpy with python-dev

just starting to get my hands dirty with snappy. I am trying to port a python project to a snappy app. The python code relies on numpy 1.5.1, which relies on python-dev being installed. My snapcraft ...
0 votes
1 answer
530 views

Why can't I start onedrive-d?

I have installed onedrive-d, since terminal, But when I want to start it, with "onedrive-d start" command, terminal gives me next error: Traceback (most recent call last): File "/usr/local/bin/...
1 vote
0 answers
746 views

Is there is any way to create a backup of python virtual environment and restore it any linux distro?

I am a fan of Linux. so always I switching into OSs in a few months. I am using also virtual box but I like physical installation them. As I am a developer I have to rebuild or reinstall my ...
0 votes
0 answers
949 views

python3-dev and libssl-dev installation failed on ubuntu 18.04

Tried to install python3-dev and libssl-dev on a new Ubuntu 18.04 with: $ sudo apt install libssl-dev python3-dev But i get the following Error: Reading package lists... Done Building dependency ...
0 votes
0 answers
909 views

urllib.error.HTTPError: HTTP Error 404: Not Found , code runs correctly in my local machine but gives 404 error in Ubuntu

File "Humo.py", line 236, in <module> bot.polling() File "/home/ubuntu/.local/lib/python3.6/site-packages/telebot/__init__.py", line 196, in polling self.__threaded_polling(none_stop, ...
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....
2 votes
2 answers
7k views

Can't get IPython to start: "ImportError: cannot import name start_ipython"

I'm trying to start IPython from the terminal. I input: ipython into the terminal and I get this output: Traceback (most recent call last): File "/usr/local/bin/ipython", line 4, in <module>...
0 votes
2 answers
50 views

Ubuntu 18.04 LTS - Broken by my reckless package removal

I've been using Linux for some time now but as my second OS (3 years I guess). I recently had to build a new machine and I decided to use Linux only (Ubuntu 18.04 LTS). It was my first time ...
0 votes
0 answers
398 views

pc and laptop not visible on local network - trying to use python http server to connect a laptop to a pc

I have been trying to set up a local HTTP server using python in order to connect a laptop and a desktop pc but with no success. Both of them are connected to the home router, the desktop via a cable ...
1 vote
1 answer
2k views

Using Kinect v1 as webcam in python

So for the last couple of days i've been trying to use my Kinect v1(1414) as a webcam for a project with OpenCV (Im using Ubuntu 16.04). I already installed Openkinect freenect (multiple times) and ...
-1 votes
2 answers
168 views

How to match lines of text that start and end with specific characters?

I have a text file which contains a list of items like below. leptop pencil group leptop book gruop buk grop laftop pensil laptop pancil laptop bag bok From this, I want to design a regex pattern ...
0 votes
1 answer
163 views

cyvcf2 not working in Ubuntu 18.04 / Python 3.7.5

I have installed cyvcf2 using: sudo apt update sudo apt install python3 python3-pip -y sudo apt install libssl-dev zlib1g-dev libcurl4-gnutls-dev libbz2-dev liblzma-dev -y pip3 install cyvcf2 When I ...
27 votes
1 answer
147k views

"Unable to locate package python-pip" When trying to install from fresh 18.04 install [duplicate]

I was following a tutorial online for python and it had me do this: akclark@enceladus:~$ pip install virtualenv But I got the following: Command 'pip' not found, but can be installed with: sudo ...
1 vote
2 answers
6k views

How to upgrade sphinx?

From the output of sphinx-build --version I see I have: Sphinx (sphinx-build) 1.6.3 How do I upgrade to the latest version, which I believe to currently be 1.8? I have tried apt install python3-...
1 vote
1 answer
1k views

Broken Python install: "raise ValueError('Namespace %s not available' % namespace) ValueError: Namespace Gtk not available"

I'm not sure exactly how I did it, but I think I broke my Python-GTK interface. I don't seem to be able to get applications written in Python using GTK libraries to run. Here is an example of three ...
4 votes
1 answer
6k views

How to co-install libpython3.5 with libpython3.6 and libpython3.7

My employer recently purchased a CamBoard pico flexx infrared camera, and now I need to install the drivers for it on my machine. Eventually I plan to use this with python and opencv2, so naturally I ...
0 votes
1 answer
2k views

Crontab - Linux - EC2 - Python - No module named 'pandas'

I'm trying to run a Python script (it's a webscraping) via crontab on EC2. But it's not working. Here is my task: SHELL = /bin/bash PATH = /usr/local/sbin:/usr/local / bin: / sbin: / bin: / usr / ...
9 votes
2 answers
23k views

ImportError:cannot import name '_gi' while trying to add any PPA repository

I have been trying to install MPV on my Ubuntu (18.04 LTS). Whenever I am trying to add a PPA repository to my system I get this error. For example, I tried this: sudo add-apt-repository ppa:mc3man/...
3 votes
1 answer
1k views

Does python on Ubuntu come with any libraries?

I'm asking this because it appears to me that the standard Ubuntu installation already comes packaged with the python library requests (although I could be wrong about this). Is there a list of, if ...
1 vote
3 answers
281 views

How can I divide an output with 2 delimiters?

By dividing with the "·" and " " characters, I would like to turn this: Hel·lo my name is E·ric To this: Hel·lo my name is E·ric Hel·lo my name is E· Hel·lo my name is Hel·lo my name Hel·lo my Hel·...
0 votes
0 answers
356 views

How to safely remove "extra" python on Ubuntu 18.04?

so I've some extra python version installed and I was wondering if there was a safe way to keep just python2.7 and python3.8 for cleanliness without any damage to the system. For instance, depending ...
4 votes
2 answers
3k views

pip3 crashing with ImportError

I used Python v3.5 to code in with the tensorflow package. Now I tried to upgrade to the newest version and pip3 crashed all the time with following error when I just run pip3: Traceback (most recent ...
1 vote
1 answer
148 views

Finding Number of Days Since a User Changed Their Password

I have searched and searched, but I'm struggling to find anything close to this. This is the task I'm trying to accomplish using Python within Ubuntu: find and print the following information: The ...
-1 votes
2 answers
11k views

How to install pymysql.cursors package in Ubuntu 14.04?

I have install that, and the following error was generated: >>> import pymysql.cursors Traceback (most recent call last): File "<stdin>", line 1, in <module> ImportError: No ...
0 votes
1 answer
2k views

How "file --mime-type path" works for a file wich has no extension

To find a files mime type which we don't know we will use file command with --mime-type argument. We know it is showing results based on given file paths extension(such like text/x-python for *.py). ...
2 votes
1 answer
559 views

Launching finder from python

I wish to input a subfolder name into terminal and have a script launch it in finder. This is my code: import sys import os fullname='/home/ash/caffe/examples/imagenet/train_rest/'+str(sys.argv[1]) ...
0 votes
0 answers
106 views

Ubuntu 18.04 terminal not opening

I have just installed python 3.7 for a project I need. I think it wasn't necessary. Already had python2.7 and python3.6 but I wanted to be sure. So after the installation, the terminal stopped opening....
1 vote
0 answers
412 views

Keeps getting dependency problems when I try to install new packages

I have been trying to install some software packages for hours now but I keep getting errors to do with python3. When running apt-get -f install this is the output, any help would be greatly ...
1 vote
2 answers
6k views

How can I remove a package completely?

I'm unable to remove the package python3-pip in Ubuntu 16.04: $ apt list |& grep 'python3-pip/' python3-pip/xenial-updates,xenial-updates 8.1.1-2ubuntu0.4 all $ sudo apt-get remove python3-pip ...
2 votes
2 answers
2k views

I cant install updates or Python [duplicate]

E: Failed to fetch http://ppa.launchpad.net/jonathonf/python-3.6/ubuntu/dists/eoan/InRelease 403 Forbidden [IP: 2001:67c:1560:8008::15 80] E: The repository 'http://ppa.launchpad.net/jonathonf/...
0 votes
0 answers
168 views

Python dist-packages UnicodeDecodeError when upgrading from 19.04 to 19.10

I tried to run the do-release-upgrade to upgrade from ubuntu 19.04 to 19.10. Unfortunately i get an error traceback pointing to python dist-packages. I replaced the dist_info.py like described in ...
3 votes
1 answer
49k views

pip3 is pointing to the wrong version of python

I have installed python3.8 and have found no reference on how to get pip3 to talk to it on ubuntu. On macos I had explicitly installed pip3.8 and that has been crucial to getting all packages lined ...
2 votes
2 answers
17k views

Python broke somehow "Could not find platform independent libraries <prefix>"

I started using Ubuntu recently and it has been a mess. I must have manually installed something important in a directory I shouldn't have. The other day I was deleting useless files that have ...
1 vote
0 answers
166 views

PCIe Bus Error and lightdm module uninstalled

Need a little help. I've Ubuntu 18.04 installed which had python 2.7 initially. Instead of updating I installed 3.6 separately without taking proper precautions and it wreaked havoc on my system. So i ...
0 votes
1 answer
565 views

Running a GUI script - everything freezes

I cloned this branch from GitHub, created a Python3 environment, activated it, and ran setup.py install. To run the GUI script, I typed https://github.com/HaseloffLab/CellModeller/tree/python3. I only ...
0 votes
0 answers
39 views

Forgot to make partition in Win 10 disk managmnt bfor dual booting Ubuntu,Now want to uninstal Ubuntu,But no partition to delete in Win disk mgmt

I dualbooted Ubuntu 16.04 alongside Windows 10. I forgot to create partition before installation and just installed and allocated space using "dragging feature". I want to uninstall Ubuntu now, but ...
1 vote
0 answers
268 views

Jupyter & Conda: how to set different working directories for different environments

i'm working on a fresh Anaconda3 installation. I want to create different environments for different projects. In each environment i want to use jupyter, so i'm installing it in each of them: conda ...
0 votes
1 answer
554 views

Is it possible to run a c++ code and send the output to a python code in a bash file? [closed]

I have a C++ code that uses NVIDIA DRIVEWORKS (CUDA) and extracts some images. I have a Python code that takes the extracted images and do processing. My question is that is it possible to run two ...
1 vote
1 answer
3k views

Ubuntu 19.10 <urlopen error [Errno -5] No address associated with hostname>

First I'm super new to ubuntu like I'm using it for like 20 hours from yahoo_finance import Share yahoo = Share('YHOO') but whenever I run the it The terminal shows: Traceback (most recent call ...
1 vote
1 answer
5k views

How to upgrade Python to the latest version [duplicate]

I have the following version of Python, in my Ubuntu 18.04 LTS. python --version Python 2.7.17 python3 --version Python 3.6.9 How to upgrade it to the latest version 3.8.2 I have already run the ...
2 votes
0 answers
1k views

Why is pip unable to install packages?

I'm trying to install this list of packages: tensorflow-gpu umap-learn visdom webrtcvad librosa>=0.5.1 matplotlib>=2.0.2 numpy>=1.14.0 scipy>=1.0.0 tqdm sounddevice Unidecode inflect PyQt5 ...
0 votes
1 answer
785 views

Ubuntu 18.04 - how to set up a Python virtual environment for Python 3.7.x or 3.8.x?

Can somebody please provided recommended commands for Ubuntu 18.04 to configure a Python virtual environment that has Python 3.7.x or 3.8.x? Of course I'm aware that upgrading the general Ubuntu 18....
0 votes
0 answers
772 views

trouble with setup.py

I'm running Disco Dingo 19.04, and attempting to install evillimiter to do some testing on my home network. However, I have run into a problem with python setuptools. icarus@Omicron:~$ sudo bash [...
2 votes
3 answers
2k views

Upgrade from 18.10 to 19.04 with *default* Python 3.6 fails with corrupt python symlink error

I'm trying to upgrade from 18.10 to 19.04 but getting the error: Your python3 install is corrupted. Please fix the '/usr/bin/python3' symlink. Note that the /usr/bin/python3 symlink points to the /...

1
33 34
35
36 37
104