Questions tagged [python]
General usage of any python tool and running scripts and Apple specific questions are on topic here. Detailed languag-specific questions about programming (where it won’t matter if python runs on any os) belong on Stack Overflow.
656 questions
0
votes
3
answers
126
views
Use macOS to do currency conversion in Python
Spotlight does currency conversion very well and very conveniently, which IMO proves that there's system libraries on macOS that do currency conversion.
How can I use the same system libraries from a ...
1
vote
2
answers
112
views
Clear output in macOS Terminal in Python script on Big Sur works, but not on Sequoia
In my .zshrc i have the alias
alias cls='printf "\033[H\033[3J"'. With this I can run
os.system(cls) in my Python script to clear the screen (and clear buffer, totally clean, just prompt and ...
0
votes
0
answers
58
views
Python import is very slow when right fan is spinning
Like many users, python import is most of the time extremely slow at importing modules. For instance, a simple :
time echo "import pandas" | python3.12
usually take about 4s to 6s on my ...
1
vote
0
answers
145
views
Why can't I uninstall Python 3.13? [closed]
I want to uninstall Python 3.13 and only keep 3.9.
I tried using brew but just get this error:
brew uninstall [email protected]
Error: No such keg: /opt/homebrew/Cellar/[email protected]
I don't have admin ...
0
votes
0
answers
45
views
Gatekeeper Disk Write Workaround?
I am developing a Python software and I'd like to generate a logs folder where .log files can populate for user-debug. When I run the file through the main init. and the .app created by PyInstaller, ...
1
vote
1
answer
94
views
Can't get a Python package installed [duplicate]
There are twelve executables named python on my intel macbook pro. None of them are in my path, but "python3" in my path points to version 3.13.4 installed by homebrew.
When I try python3 -...
1
vote
2
answers
394
views
Can I stop macOS asking for screen recording permission while using mss.mss() in a python script?
I am trying to use mss to capture a portion of my screen using the following code:
import mss
import cv2
import numpy as np
monitor_region = {
"top": 810,
"left": 1070,
...
2
votes
2
answers
91
views
mDNS discovery work on shell, but not in LaunchAgent
I've built a simple Python script that tries to discover my Sonos speakers via mDNS/UPnP/Bonjour and set some music sources to them. This is done using the soco lib.
The script works well when started ...
0
votes
2
answers
321
views
New to MacOS, setting up my python virtual environment
I'm fairly new to MacOS, when i try to directly do
pip install
the terminal whether in VScode or the normal mac terminal gives the output as
zsh: command not found: pip
But if i execute the same ...
0
votes
1
answer
48
views
Python 3 - problem converting keyboard input to integer [closed]
I'm having a problem using the int() function on a user input from the keyboard in Python 3 (latest version from website). The actual program will perform various numerical calculations, but I have ...
0
votes
0
answers
41
views
What is in `/usr/bin/python3`? [duplicate]
I'm on macOS Sequoia 15.3.2, and I've been experiencing some weird behavior with /usr/bin/python3 lately. Usually it seems like a perfectly normal Python 3.9 binary:
$ /usr/bin/python3 --version
...
0
votes
0
answers
55
views
AppleScript to Schedule Emails for Specific Date
I am in the process of writing a small Python Script to automate sending some emails that I send every week, specifically every Monday at 8 AM. The Python script calculates when the next Monday will ...
1
vote
1
answer
84
views
Numeric keypad not working in Python interpreter on Magic Keyboard
The numeric keypad on my Magic Keyboard does not work when I am running the Python interpreter in interactive mode. The regular numbered keys do work for entering numbers. But when I try to enter a ...
0
votes
1
answer
75
views
Obliterating any trace of icon, but it still appears in Python-made notifications
I am using Jorrick's MacOS notifications generator to make custom popup notifications. Whenever one appears, it uses the Python Launcher rocketship icon, like this:
I want to replace the rocketship ...
0
votes
0
answers
82
views
Sonoma: Permanently allow Python to open a server port?
Recently starting a python process that opens a server port always triggers the Firewall dialog
Do you want allow that Python.app can accept incoming network connections? (translated)
As the system ...