Questions tagged [python]
Python is an interpreted, general, high-level programming language. Programming questions are off topic. Questions about the use of Python should be asked at Stack Overflow (https://www.stackoverflow.com) instead.
3,216 questions
11 votes
2 answers
2k views
If any Python process is running, keep the screen on - Windows 11
In the power settings, my computer is configured to turn off the screen after 2 hours of inactivity. In all of my Python projects that I run at random times during my day I add a function that runs in ...
1 vote
1 answer
42 views
apt-get python not installable but it is
On Ubuntu, trying to install a deb-file (armory 0.96.5), I get the error: depends on python (>= 2.6), but it is not installable. Well, it already is installed and just typing python --version in ...
-1 votes
0 answers
65 views
Error when installing programs using pip3
have mac OS Tahoe 26.2.1 with pythin3.7.2 and trying to install docx with following command: pip3 install python-docx openpyxl docx2pdf I get this error: Could not find a version that satisfies the ...
0 votes
2 answers
82 views
pip is broken after pip upgrade - ModuleNotFoundError: No module named 'tomllib'
I upgraded PIP, now any call of PIP results in an error. Any suggestions in Internet to restore PIP ... are using PIP itself. I mean: how can I use PIP to resolve the problem if excatly the PIP is ...
2 votes
1 answer
213 views
How can I set the default Python version that gets launched when typing python3 (On Windows 11)?
Overview My exact goal is to set my preferred version of python as the default when I type python3 into a command prompt or powershell prompt. I've tried everything but can't figure it out. I have the ...
1 vote
2 answers
58 views
How to fix g++ error when trying to install software on Ubuntu 24.04.3?
I am unable to install a software package that runs inside/alongside another package. When installing/setting up the software I receive a g++ failure: error: command '/usr/bin/g++' failed with exit ...
0 votes
1 answer
118 views
How to stop indentation with spaces for python files in vim
I have done all i can in .vimrc: $ cat ~/.vimrc set nocompatible syntax enable filetype plugin on " Allow recursive file find set path+=** set wildmenu " stop using spaces for tabs! ...
0 votes
0 answers
35 views
Why is my macOS Terminal is no longer recognising most common commands? [duplicate]
Feeling way out of my depth with this one. I have been trying to install Tartube on my MacOS via terminal. This involved installing Homebrew, Python 3, Gtk 3, Python Requests Module, Youtube-dl, the ...
2 votes
1 answer
274 views
How to open Windows snipping tool (snippingtool.exe) in Python?
I would like to open snippingtool.exe immediately ready to snip, similar to the function you get when you press the Win-key + Shift + S key combination (i.e. not the application window) from within ...
0 votes
0 answers
38 views
Why does Windows search sometimes drop results even if the query matches its name better?
First off, I know Windows search has never been good (or at least not in a long time). However, this behaviour boggles my mind: Why is "Python" the top result when searching "p", &...
1 vote
1 answer
371 views
How can I configure agents in Cursor to use a specific Python virtual environment?
I am using Cursor and I am working on a Python project that relies on a virtual environment (conda). When an agent runs code, installs dependencies, or executes Python commands, it does not use my ...
-2 votes
1 answer
100 views
How to install Python2 zlib on Ubuntu 24?
I am trying to set up my Python2 virtualenv on Ubuntu 24. The following script worked on Ubuntu 16-20. It would set up a virtualenv named _py. mkdir -p _py git clone https://github.com/pypa/virtualenv....
1 vote
2 answers
323 views
How to install python app with specific python version by uv
I'm trying to install DisplayCAL by uv pip install. But also, I'm in Fedora with native python 3.14. App won't run because it ask python version in range 3.8 → 3.13 only. So how can I install it with ...
4 votes
1 answer
5k views
VSCode does not activate my Python venv, despite displaying the correct interpreter
I am running VSCode on Ubuntu 24.04.2 LTS, with the Python VSCode extension installed. I have a .venv located in the root folder (rwdocs) of my workspace, which I have selected as the python ...
0 votes
1 answer
73 views
How to comment some code in PyCharm using Swiss/German keyboard?
I am trying to learn Python using PyCharm and my Swiss/German keyboard. The usual shortcut to comment some code (line or block) is ⌘ + / which should become ⇧ + ⌘ + 7 on a Swiss/German keyboard since ...