2022 Developer Survey is open! Take survey.

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.

Filter by
Sorted by
Tagged with
1 vote
0 answers
17 views

How do I allow specific (uncodesigned) programs to access certain keychain items without password?

I use the python keyring module to interact with with macOS Keychain, and I got a prompt to enter my login password to allow access (which I always click "Always Allow") every time I run my ...
user avatar
  • 1,076
0 votes
2 answers
95 views

Upgrade to Monterey, now Automator action doesn't find python any longer

Ubuntu variant here but now the question in Apple OS X $ "/System/Library/Automator/Combine PDF Pages.action/Contents/Resources/join.py" -o out.pdf *.pdf env: python: No such file or ...
user avatar
  • 3,626
0 votes
0 answers
35 views

BASH vs Python? Is BASH slow? Or is it On-Site Server?

I'm fairly new to writing scripts, so this might be a really amateur question. My job consists of a lot of copy/sorting/downloading/indexing files on an on site server while I work from home. So ...
user avatar
0 votes
1 answer
25 views

Cron job is python script not executing automatically altough cron and Terminal was added to full disk access

I set up a cron job for writing every minute from a python script an entry into a log file which is created from the python script. The python script is working fine if I execute it manually but it ...
user avatar
0 votes
0 answers
74 views

ssh trying to use python2 after I upgraded to 3

I upgraded to Mac OS 12 a day ago and it has broken a few things for me. Since then I used brew install python and pyenv to get Python 3.10 running. But now ssh doesn't run. Even getting to the help ...
user avatar
  • 123
0 votes
1 answer
84 views

How to fix hash problem in macOS 12.3.1?

When I am going to install something, it shows the following errors in my macOS Monterey 12.3.1: apples-MacBook-Air:~ apple$ pip install pandas ERROR:root:code for hash md5 was not found. Traceback (...
user avatar
  • 101
0 votes
1 answer
1k views

Mac OS 12.3+ /usr/bin/python requirement

As of macOS 12.3, Apple no longer ships Python 2 However, I am trying to install a program (.pkg installer) that depends on /usr/bin/python and it fails. In /var/log/install.log I see this error: /usr/...
user avatar
  • 131
0 votes
1 answer
48 views

Automate switching virtual desktops on macOS

I'm making an app (in python) that requires a way to switch macOS virtual desktops (spaces) using a keyboard shortcut, terminal command, etc. It pretty much doesn't matter how its done as long as it ...
user avatar
1 vote
1 answer
163 views

Apps broken after Monterey 12.3 update

After having updated macOS to Monterey 12.3 a number of programs or apps are failing to work. For example, when trying to run perl I obtain -bash: /usr/local/bin/perl: Bad CPU type in executable Same ...
user avatar
  • 131
1 vote
1 answer
46 views

pkg installer error in macOS 12.3: rights in /Library/Application Support

Are there any changes in the rights of the folder /Library/Application Support starting with macOS 12.3? Our application refuses to install, our postinstall script fails to create a folder (and files ...
user avatar
  • 121
0 votes
2 answers
104 views

Why are there two apps called “python” and "python launcher" seperately?

Why are there ‘Python’ and 'Python launcher’? What’s the difference? "Python launcher" is in Applications/python 3.10/python launcher “python” is in the MacintoshHD/library/frameworks/python....
user avatar
0 votes
0 answers
23 views

Make PDF dark-mode friendly in Adobe DC Acrobat Reader or alternative

I was looking for a way to read a PDF in "dark mode". Found this answer here However I was curios if there's a way to make Adobe Acrobat Reader more dark-mode friendly or if there exists an ...
user avatar
1 vote
1 answer
54 views

What is the purpose of pythonwrapper, and how can I distinguish it from an executable Python interpreter?

I have a Bourne script that takes a Python command (Python interpreter and arguments) and reroutes it to a custom Python interpreter. I want to make sure that modules that would be on the path of the ...
user avatar
  • 111
8 votes
2 answers
6k views

Restore Python 2.7 on Monterey 12.3?

The Monterey 12.3 upgrade removes Python 2.7 with no user warnings. Homebrew only knows about Python 3. What other ways are there to get Python 2 back up and running? I'm not interested in hearing ...
user avatar
  • 458
1 vote
2 answers
94 views

I installed Python3 using Homebrew - but I didn't get a launcher. What do I do to get one? [closed]

How can I get a Launcher for Python3 on the Mac Catalina? Does installing from Homebrew just not provide one?
user avatar
0 votes
1 answer
81 views

How do I make my python app default to run in rosetta?

I have a Python app that requires some modules that do not have universal binaries. It will not launch natively but runs fine on rosetta2. The primary purpose of this app is to remove setup issues ...
user avatar
0 votes
1 answer
208 views

How to fix "There was a problem confirming the ssl certificate"?

I am trying to use Kivy on a Mac 10.14.6 to create a Python Android application following the tutorial HERE. When I run the command to build the app python3 -m buildozer -v android debug I see the ...
user avatar
  • 855
0 votes
1 answer
41 views

How can I trigger a mac daemon on an event other than scheduling a time interval?

I have made a few Mac daemons in the past. They either run at launch or run at a specific time interval, for example, once every hour. I would like to know if it's possible to run a program on an ...
user avatar
0 votes
2 answers
107 views

how to change extended attributes on mac recovery

xattr worked on mac desktop system but I want to let it work in mac recovery terminal but xattr is not included in bash of terminal I copy xattr to usb drive and run it on recovery terminal ,but it ...
user avatar
11 votes
4 answers
20k views

M1 mac: mach-o file, but is an incompatible architecture (have 'x86_64', need 'arm64e') - python

When I try to run "scrapy startproject" in vscode, below error comes up. Traceback (most recent call last): File "/Users/admin/Desktop/development/project/scrapyTutorial/venv/bin/...
user avatar
  • 113
0 votes
0 answers
833 views

Getting SystemError: Cannot compile 'Python.h' while installing numpy==1.20.3

My Mac was bought in 2015 with macOS Catalina. I was trying to install numpy 1.20.3 but during installation I got the below error in Terminal: SystemError: Cannot compile 'Python.h'. Perhaps you need ...
user avatar
1 vote
0 answers
707 views

UNSAFE_LEGACY_RENEGOTIATION_DISABLED on Mac OSX

I am running some python code that uses a library (urlib3) to access an API for some data. However, when the API endpoint is accessed, I get an SSL error of UNSAFE_LEGACY_RENEGOTIATION_DISABLED. The ...
user avatar
0 votes
2 answers
423 views

Python 3.9 does not find packages that work with Python 3.8

I have a hard time understanding how Python is installed on my Mac. Not sure if it is important, but I have a Macbook Pro with an M1 Pro chip and come from years of using Linux with a package-manager ...
user avatar
  • 103
1 vote
3 answers
66 views

Using a Python String on a Mac for a Non-Coder?

I'm thrilled to find Navddeep's solution here How to convert an epub package to regular epub? yet two essential questions arise as I try to implement it. What in the string must I change to identify ...
user avatar
0 votes
1 answer
80 views

Mac Terminal doesn't obey ANSI "Show Cursor" Escape Sequence; Can't Regain Cursor Visibility, suspect State issue

System: I'm writing a Python 3 script using ANSI escape sequences on an Intel iMac Pro running up-to-date Monterey. Problem: I hide the cursor when printing a lot of ASCII animations to the screen. ...
user avatar
1 vote
0 answers
98 views

Enable multithreaded BLAS/LAPACK in NumPy @ macOS BigSur 12.1

I would like to enable a multithreaded BLAS/LAPACK backend for Python's (v3.9.9) NumPy on my macOS BigSur (v12.1). When I run my NumPy code, I see in htop, that only one python process is running and ...
user avatar
  • 131
1 vote
1 answer
865 views

If the new MBPs (M1) come with Python3 pre-installed, why don’t Python scripts run in shell?

I've been reading through lots of "how to"s on using Homebrew to install Python3 and Python packages, but from my terminal queries, it looks to me that Python3 is already installed: MBP21:~$ ...
user avatar
  • 233
0 votes
1 answer
375 views

Why does the shell run the incorrect Python?

I am coming from an Ubuntu environment, and since you can set Python 3 to be the first-class Python in Ubuntu (as in, you call python and you get Python 3), I wanted to do the same on the Mac I've ...
user avatar
  • 101
1 vote
1 answer
232 views

MacOS Firewall: Program grayed out, can't be added to Firewall Options

In MacOS Monterey (12.0.1), I am running Python 2.7 from an Anaconda virtual environment. Each time I run the Python script, I am asked if I want to accept incoming network connections: I have tried ...
user avatar
  • 7,967
1 vote
0 answers
370 views

Catalina and pyenv install python versions fine, but anything needing ssl fails

I seek to use pyenv instead of manually installing an official python release. My goal is to run the included script titled “Install Certificates.command”. My assessment of the situation is pyenv is ...
user avatar
0 votes
0 answers
72 views

how to change terminal back to default

Recently I tried to set up a path for my python I ended up messing up my zsh shell. whenever I open it, this is what I see Last login: Mon Nov 15 16:18:26 on ttys001 WARNING: Python 2.7 is not ...
user avatar
0 votes
0 answers
42 views

M1 Mac - Getting errors during the installation of the Mac-specific tensorflow-macos package

As the title is self-descriptive, despite using the Mac-specific package of TensorFlow, tensorflow-macos, I'm getting the following error stack trace during the installation through the pip: https://...
user avatar
  • 265
0 votes
0 answers
126 views

Need help running 'backup_tool.py' Python script to decrypt my iPhone backup

When I updated to iOS 15 I lost over 1k of my voice memos. I am a song writer so really want these recordings back. I'd prefer to do this the fun way and save the $40 on a clunky backup/restore app ...
user avatar
1 vote
0 answers
287 views

Linker errors in Monterrey

I'm trying to build a native python module on Monterrey and I'm getting the following error: gcc -arch x86_64 -fno-strict-aliasing -O -fPIC -shared -lpython2.7 build/nodepos.o build/pyspidermonkey.o -...
user avatar
  • 3,365
0 votes
0 answers
58 views

Python installer .pkg fails with "An unexpected error occurred while moving files to the final destination."

I am getting back up and running on a new MacBook. I used Migration Assistant to get most of the way there. However, I have python virtual environments which depend upon python versions which were ...
user avatar
1 vote
0 answers
787 views

How would I export data from Python to spreadsheet (Apple Numbers Format)?

I'm currently trying to automate the export of data from a Python script to Apple's .numbers spreadsheet. Currently, I export from Pandas using .csv. My specific use-case is to update an existing ...
user avatar
-1 votes
1 answer
103 views

What is the current correct way to install pip on macOS? [closed]

I'm seeing a fair amount of conflicting information on Reddit and Stack Overflow on this topic. I'm a long-time Linux user, just bought my first macOS computer. For python development, I'm seeing that ...
user avatar
1 vote
0 answers
203 views

Correct packages installation without using Homebrew

I was reading this old post because I want to download a homebrew package without using brew : How to download a binary from brew without installing brew? but I'm stuck so I try to ask too. I'm on ...
user avatar
1 vote
1 answer
200 views

ZSH conflict with Python setuptools extras and pip?

I have installed python 3.9.7 using pyenv. I then installed a package webchanges which has optional dependencies to be installed using setuptools extras and pip format: pip install --upgrade ...
user avatar
  • 717
0 votes
1 answer
115 views

Permissions on `brew` and `pip3`

Somehow permissions have been altered on brew and/or pip3 and both are getting errors. brew has a lock file but when I remove it with sudo, brew commands say it iw still there. pip3 worked to install ...
user avatar
  • 3,355
1 vote
1 answer
564 views

How to install Anaconda on External Hard drive?

I have the Apple Silicon Macbook Air with 256 GB, and am interested in installing Anaconda mainly Jupyter notebook in my Mac. When I tried installing it on my external Hard drive, which is a 1TB SSD, ...
user avatar
0 votes
1 answer
178 views

How do I prevent zsh from suspending python script

Someone once told me that zsh is just a different version of bash because of some copyright thing, so I guess I ask this question here. I have a python script that's running in a terminal and for no ...
user avatar
3 votes
3 answers
1k views

How to delete a system file as an admin

I am an "admin" user on a Mac running Big Sur. I am trying to remove a symlink: $ ls -al /usr/bin/python lrwxr-xr-x 1 root wheel 75 Jan 1 2020 /usr/bin/python -> ../../System/Library/...
user avatar
  • 161
0 votes
0 answers
156 views

Cannot run Python script using IDLE 3.9 from Finder

When I try to run a Python script I have from Finder, I get the following error (see image): Anyone have any ideas what is going on with this? Thank you!
user avatar
  • 1
0 votes
0 answers
108 views

How can I get screen grab pixel data from a different 'desktop space' than the one I am currently viewing?

I'm wanting to find some way of using Python to get colours of pixels to notify me when a change happens on a game. The point is, I don't want to have to keep the game on the front of the desktop and ...
user avatar
1 vote
2 answers
1k views

Set python version on MacOS Big Sur [closed]

does someone had situation when "python --version" says "Python 2.7.16", but installed version is 3.7 Command "pyenv versions" says "* 3.7.11 (set by /Users/dima/....
user avatar
  • 113
1 vote
1 answer
78 views

How can I get .py text documents to show up in recents?

While recent .txt and .rtf documents show up in Finder's Favorites "recents", my .py plain text documents (Python scripts) never do, and that's by far the most common file type I need to ...
user avatar
  • 1,298
0 votes
0 answers
52 views

How to execute bash/python scripts as soon as device goes to sleep? [duplicate]

I was hoping to write a script that would execute a few commands as soon as I close the lid of my laptop and run them again when I open my laptop. I know I can get the system details with pmset -g, ...
user avatar
0 votes
1 answer
206 views

Byobu not working on new installation of macOS

I am trying to migrate from Linux to macOS, but apparently byobu is not working out-of-the-box on my machine. The Fn keys partially work. I can see the error message "no previous windows" ...
user avatar
  • 101
0 votes
2 answers
919 views

What version of python is the one that I cannot uninstall

I installed python (newer version than the one shipped with my machine) and it seems to work. I looked at pip, got confused and now I am not sure if I messed up. When I execute python --version I get ...
user avatar

1
2 3 4 5
11