python

Why is apt so dependent on individual Python versions?

Why is apt so dependent on individual Python versions? We get a lot of questions here about people messing with Python versions and ruining their systems, most noticeably that apt fails to function properly. I am aware that many Ubuntu packages require specific versions of Python to function properly. My question is: what makes a …

Total answers: 1

Installing python3.10 on Ubuntu23.04, alongside with python3.11 causes apt crash

Installing python3.10 on Ubuntu23.04, alongside with python3.11 causes apt crash I need to use python3.10 on Ubuntu23.04. I’ve tried to install python3.10 on Ubuntu23.04, alongside with python3.11. And, it looks like it has been installed. But, python3.10-venv didn’t. Than I’ve tried to switch versions and try install python3.10-venv again, working under python3.10, and looks like …

Total answers: 1

netplan with multiple versions of python

netplan with multiple versions of python Currently, I have two versions of python installed in Ubuntu 20.04. I noticed that if I select python3.10 as python3, then netplan got errors. If I switch back to python3.8, then netplan works fine. The command I use is sudo update-alternatives –config python3 I also tried to uninstall netplan …

Total answers: 1

Is it a good practice to restart VPS server everyday?

Is it a good practice to restart VPS server everyday? I am building an app server using Ubuntu 20.04 and will be serving thousands of clients with potentially a million http messages everyday. I wanted to ask if it is a good practice to restart my server everyday at midnight? I think this will help …

Total answers: 1

Reading X11 properties

Reading X11 properties I want to write my own status bar, that would be EWMH compatible, which means I have to read some X11 properties like: _NET_NUMBER_OF_DESKTOPS _NET_DESKTOP_NAMES and such. So my question is how do I actually read them? Have already tried python-xlib and python-ewmh modules but with no luck. Maybe there’s a command …

Total answers: 1

linux + network scanner tool that discover Linux rhel machine

linux + network scanner tool that discover Linux rhel machine we have network lab range from 18.2.1.1 until 18.7.252.253 , and we want to capture only the Linux RHEL machines with version 7.x ( /etc/redhat-release ) , ( we have around 2870 machines and only 390 RHEL machines ) of coerce I can create bash/python/perl …

Total answers: 1

Build mediapipe on Linux (Ubuntu 22.04)

Build mediapipe on Linux (Ubuntu 22.04) I’m trying to build MediaPipe from source with Bazel on Linux ubuntu 22.04. here are the full steps ive done so far: 1. git clone https://github.com/google/mediapipe.git 2. cd mediapipe 3. bazel build -c opt –define MEDIAPIPE_DISABLE_GPU=1 mediapipe/examples/desktop/desktop/holistic_tracking:holistic_tracking_cpu but it’s always failing with the following error: In file included from …

Total answers: 1

Deleted python and now can not login into interface

Deleted python and now can not login into interface I started learning some python. I already had python2 and python3.8 installed as defaults. But recently installed additional version python3.11. It was not working as expected so i decided to get rid of it. But accidentally removed ALL python versions and after a reboot I am …

Total answers: 2

Missing libmpdec2 for deadsnakes libpython3.9-stdlib in 22.04 LTS (jammy)

Missing libmpdec2 for deadsnakes libpython3.9-stdlib in 22.04 LTS (jammy) From deadsnakes at http://ppa.launchpad.net/deadsnakes/ppa/ubuntu the libpython3.9-stdlib depends on libmpdec2, but that is not available on 22.04 LTS (jammy) as far as I can tell, see https://packages.ubuntu.com/search?keywords=libmpdec2. The page displays that libmpdec2 is available for 18.04 LTS and 20.04 LTS. What is to do in this case? …

Total answers: 1

do-release-upgrade broke python's virtual environment and pip

do-release-upgrade broke python's virtual environment and pip I did a release upgrade, followed by apt upgrade no problem, everything went smooth. Except, now virtual environments don’t work at all. I have various one set up for various django projects I’m working on. When I try to run django manage.py runserver I get: ModuleNotFoundError: No module …

Total answers: 1

How to run Python code using Codon in Ubuntu

How to run Python code using Codon in Ubuntu I have a Python code, and I wanna use Codon to run it. To do this, I first need to install it. I copy and paste the code /bin/bash -c "$(curl -fsSL https://exaloop.io/install.sh)" in terminal. Every time that I run this code, it install codon again …

Total answers: 1

Redirect stderr doesn't show python input

Redirect stderr doesn't show python input I am running the following command on the terminal: python -c "input(‘Message’)" 2> log but the Message doesn’t appear on the screen. Any ideas why this happens? Asked By: ado sar || Source In these circumstances, and in spite of what the documentation says, Python writes the prompt to …

Total answers: 1

Archives directory /var/cache/apt/archives/partial is missing

Archives directory /var/cache/apt/archives/partial is missing I am trying to install a python version on linux. But I am getting the following error: Archives directory /var/cache/apt/archives/partial is missing I have tried to create the file by : mkdir -p /var/cache/apt/archives/partial But i am getting the following: mkdir: cannot create directory ‘/var/cache/apt’: File exists Edit: ls -l …

Total answers: 1

Extremely slow GPU memory allocation

Extremely slow GPU memory allocation I’m having a problem with extremely slow memory allocation on an nvidia GPU from Python. When running a GPU calculation in a fresh Python session, tensorflow/pytorch allocates memory in tiny increments for around four minutes until it suddenly allocates a large chunk of memory and performs the actual calculation. All …

Total answers: 1

Opencv crashes on startup

Opencv crashes on startup Trying to use face recognition on real time on my webcam but opencv crashes just after opening camera. here is the code: import face_recognition import cv2 import os import re fileIndex = { ‘#png_files’ } video_capture = cv2.VideoCapture(0) known_face_encodings = [] known_face_names = [] for n in os.listdir(‘#path’): sp = os.path.splitext(n) …

Total answers: 1

Pycharm false import error alarm although code executes

Pycharm false import error alarm although code executes I am new to PyCharm IDE (accustomed to VS code). I am getting an import error alarm on IDE with the following line of code: from tensorflow.keras.preprocessing.text import Tokenizer Error: Cannot find reference ‘keras’ in ‘__init__.py’ But when I actually hit run, it perfectly prints the output …

Total answers: 1

python3-serial miniterm.py location

python3-serial miniterm.py location I am trying to install python3-serial on ubuntu (18.04 and 20.04) and can’t seem to get miniterm.py in PATH. From what I’ve read, it should be installed either in /usr/bin/miniterm.py or /usr/local/bin/miniterm.py, but it doesn’t get installed anywhere. I have tried the following: sudo apt install -y python3-serial pip install pyserial in …

Total answers: 1

No module called Pandas on the just installed Ubuntu 22.04 and PyCharm

No module called Pandas on the just installed Ubuntu 22.04 and PyCharm I was with assumption that Ubuntu has all the packages needed for Python. I mean Python3. I installed PyCharm. I just ran this import pandas as pd, got the no module found error. I am surprized. Does it mean I have to install …

Total answers: 1