Questions tagged [python]
Python is an interpreted, general-purpose high-level programming language whose design philosophy emphasizes code readability.
2,343 questions
0
votes
0
answers
28
views
Linux kernel “BUG: Bad page state / Bad page cache in process python” during PyTorch distributed training (NVidia 5090 + Ubuntu 22.04)
I’m encountering a recurring kernel memory error while running heavy PyTorch training workloads .
The system eventually becomes unstable, training stops, SSH disconnects, and the machine needs a ...
2
votes
0
answers
33
views
Automatically check if my Nvidia GPU, CUDA drivers, cuDNN, Pytorch and TensorFlow are all compatible between each other?
I'd like to know if my Nvidia GPU, CUDA drivers, cuDNN, Pytorch and TensorFlow are all compatible between each other ahead of time instead of getting some less explicit error when running code such as:...
0
votes
0
answers
36
views
firewalld corruption python-nftables command not found
this is in RHEL-8.10 x86-64
from a clean install from rhel-8.10-x86_64-dvd.iso and only using the public.xml file;
the only things I do is
# quad port nic with eno4 being my wan connection
firewall-...
1
vote
0
answers
31
views
Konsole with application disappears
We develop and distribute an application that controls industrial robots (non real-time typically). We run it on Kubuntu 22.04 in a Konsole window. It is runs continuously for several months at a time....
3
votes
1
answer
250
views
How to run one installed Jupyter Notebook from one venv/virtualenv environment and use packages from another venv/virtualenv?
I've set up different Python venv/virtualenv environments on my Debian 12, each with their own packages.
However, I want to use/install Jupyter Notebook only once (in just one virtual environment).
...
-1
votes
1
answer
141
views
How to show all Python venvs on my server?
My command prints
>>> import sys
>>> print(sys.prefix)
/home/DEVOPSM/CodeTest_Ucar/venv
Is it possible to list all other virtual environments on Linux?
0
votes
0
answers
54
views
Why does Ctrl+C clear the current input line in my Python socket-based Telnet-like shell?
I'm building a simple shell server using raw Python sockets (not using telnetlib). The client connects using PuTTY with the Telnet connection type.
The server displays a basic prompt like:
[user@...
0
votes
1
answer
96
views
Force Qutebrowser to close tab and open default one when there is one tab in the window
In Qutebrowser, I try to create the following behavior:
tab-close, or at least the action associated with it (i.e., pressing d), should, in all situations where more than one tab is open, close the ...
0
votes
0
answers
99
views
Pyright in VSCodium is confused about type-checking a function assigned to a variable
I'm using VSCodium with the Pyright plugin for Python type checking. I am puzzled why Pyright is not recognizing a variable as type function, when the code works as expected, and entering this code ...
0
votes
1
answer
187
views
Installing python3.10 on debian:stretch-slim image?
I have an docker file where the base image is set to debian:stretch-slim. The default version of python3 is python3.5 in this image.
FROM debian:stretch-slim as base-os
....
....
RUN python3 -V
RUN ...
1
vote
0
answers
69
views
How can I reliably block GUI-initiated system shutdown when systemd-inhibit only delays terminal shutdown commands?
I'm developing a desktop application using PySide6 for Linux, and I need to prevent or delay system shutdowns that are initiated from the graphical interface. I know that running systemd-inhibit --...
0
votes
1
answer
297
views
How to install DNF packages using Yum when Python packages are in a different location
We have a RHEL 8.10 server, and the default location for Python packages is under /usr/lib/python3.6/site-packages/. This includes, of course, the DNF packages located at /usr/lib/python3.6/site-...
1
vote
0
answers
54
views
Xorg not starting when invoked from Python
I'm creating a display manager (dm) in python, which waits to Xorg to start in order to run the GUI.
Python
(omitted unnecessary code like widgets and classes and functions)
import os
(more imports ...
0
votes
1
answer
246
views
Captive Portal w/ nginx, hostapd, nftables, dnsmasq
I'm trying to make captive portal with nginx, hostapd, nftables, dnsmasq and python-flask.
I have two main problems
I'm not getting a popup on Android, but am on Iphone/OSX.
I'm not sure how to ...
0
votes
1
answer
79
views
How to open line in $EDITOR while in python shell?
As a somewhat new user, I recently discovered the trick of opening the current terminal line in $EDITOR, using the hotkey C-x C-e. This has changed my life, and has made writing loops and such much ...
0
votes
0
answers
46
views
Running py2debi for ffsubsync, I get: "No such file or directory: 'requirements.txt'"
I'm trying to follow the advice here:
Install a Python package on Debian/Devuan when apt has no package for it
and create a Debian/Devuan package for the ffsubsync Python package. All the dependencies ...
0
votes
0
answers
26
views
Does Nautilius the file manager customizer allow one to right click and pass into a python function the file right clicked as argument without error?
I am working on creating a way to right click on an .eml file, right click, and have python pull two pieces of data from it and paste them into a new xlsx file and auto open the xlsx file.
I would try ...
0
votes
3
answers
321
views
awk/sed in loop to replace numbers (with result of computation)
I am relatively new to awk and sed.
I have a file with more than 30000 rows/lines; e.g.,
Direct configuration= 5
0.86331344 0.14835363 0.01770155
0.83813858 0.74789354 0.31772038
0.89805721 0....
0
votes
0
answers
67
views
Struggling to Get Jupyter Python Kernel Working in VSCodeium on Arch Linux - Should I Switch Back to Windows?
I've been facing issues with getting the Python kernel to work in Jupyter notebooks on VSCodeium (my Arch Linux setup) for the past 3 days. Despite managing to start the kernel after much ...
0
votes
0
answers
59
views
Install Python packages with Chef
What is the best practice for installing Python pip packages with Chef?
I thought about the poise-python, but I've read that it stops maintenance.
And a direct install at recipe like:
execute 'python ...
0
votes
1
answer
626
views
How to use python systemd.journal module to log to a newly created systemd journald namespace
The python example here allows me to log to the systemd journal just by adding logger.info("Hi Mom"). I want to log to a different journal namespace with custom/longer data retention period ...
6
votes
3
answers
1k
views
APT broken due to broken python libraries
I am on Debian 12.
I made a rookie error installing python libraries (numpy, pandas, sklearn) using apt and now whenever i try to install or uninstall anything i get this error.
When installing
...
2
votes
2
answers
889
views
calling python within bash script
I am attempting to call python within a bash script, but the script cannot find it. I have not done bash script programming for over 30 years, so I am not currently adept at bash script debugging. I ...
1
vote
0
answers
40
views
Quarantining Python code from being updated
I have installed Onboard (virtual keyboard) and it resides in
/usr/lib/python3/dist-packages/Onboard/
I have made some changes to a few of the files (for a modified layout) which I want to quarantine ...
0
votes
1
answer
546
views
Set environment variables in a python script and use them in a chained call [duplicate]
I would like to set a couple of environment variables in a Python script, then use said environment variables in a chained call.
For example, a python script called set_env.py:
os.environ["MY_VAR&...