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
0 votes
1 answer
56 views

iTerm2 Python scripting on M1/M2 (Apple Sillicon)

iTerm2 can be scripted with Python When I run Python REPL or Python script through iTerm2 Scripting menu on Apple Sillicon architecture (M2 in my case) it terminates with following error: Bad CPU type ...
1 vote
1 answer
9 views

Why isn't my Platypus-built app accepting dropped folders?

I have a little Python 2.7 script I turned into an app using Platypus a number of years ago. After updating Platypus to the latest version (5.4.1) I just wanted to rebuild the app so it would start ...
  • 151
0 votes
0 answers
15 views

Is there a way to trace syscalls without disabling SIP?

I'm trying to optimize a local Python script and I'd like to see syscalls etc. dtruss seems like a great tool for that, but I get a series of errors when I run it that I think are related to SIP being ...
  • 6,441
0 votes
0 answers
13 views

VS code using older file versions - required to run setup.py to run changes

I'm using vs code working with my repository. Every time, I save one of the files, the updates seemingly aren't going through, as when I run a file that imports one of these changed saved files, vs ...
  • 1
0 votes
0 answers
37 views

Old iPads and data pull automation

I have 20 old iPads (mini 5th gen, software version 12.2) that are used for note taking daily. The application, Tap Forms HD has a export folder that holds a .csv file. The .csv file is still stored ...
  • 1
0 votes
0 answers
16 views

A script that opens .py types in values required

First a bit of backstory, when I do python assignments I had to manually add inventory items again and again which was painful so I wrote a shell script which would start my python program and enter ...
0 votes
1 answer
356 views

How can I set Python symlink in MacOS Ventura?

I am trying to set a symlink so that I can point the python command in Terminal to a new install of python3. I last did this in Mojave, where one could disable csrutil and then run the following ...
  • 351
0 votes
0 answers
79 views

Problem with VSCode and Python on a Mac

I am trying to use VS Code to program in Python on my Mac. I keep getting the following error when I run my program in VS Code: python -u "/Users/davidcfeola/Desktop/Python/Segmented Turning Data....
0 votes
1 answer
151 views

Set Mac to wake and run scripts while in sleep mode

I'm a Python developer and I would like the Mac to awaken from sleep when I configure it to do so and run some scripts or certain programs during the day. On Windows there's "Task Scheduler" ...
0 votes
0 answers
64 views

Python script hangs on importing rasterio

I'm a recent migrant from Linux to OSX, and the transition so far has been quite smooth, until this particular issue. On a MacBook Pro with the M1 chip, running Ventura 13.1, and with both Python 3.9 ...
  • 101
0 votes
0 answers
24 views

Automator remove all but the first page of a pdf in Monterey

Under Monterey, Is there an easy way to have automator delete all but the 1st page of a pdf file. Or extract the 1st page? My end goal is to create a thumbnail image from the 1st page, but the ...
1 vote
0 answers
30 views

Using NVidia‘s CUDA and corresponding Python libraries on macOS Monterey

I occasionally need to work on scientific software that uses CUDA and is written in Python. If possible, I would like to do that on an iMac 2019 (Intel, with a Radeon Pro 580X, running macOS Monterey ...
  • 3,338
1 vote
0 answers
150 views

MacOS can't display an open3d window from remote server,GLX_ARB_create_context_profile is unavailable

Problem Device and OS version: MacBook Pro 2021 Apple Silicon 13.0.1 (22A400) The remote server can't forward open3d window to my Mac the codes are as follows: import copy import numpy as np import ...
1 vote
0 answers
26 views

How to automatically set Terminal profile for different conda environment

I often use different conda environments. For convienience, I like setting different Terminal profiles (colors specifically) for each environment for ease of use. This is currently done manually after ...
  • 131
1 vote
0 answers
36 views

pip ALWAYS installs to /usr/local/lib/python2.7

I cannot find a way to get a functioning pip3 on macos Big Sur. I have tried standard python, HomeBrew python, and also pyenv/venv, following the directions and searching for issues in each case. In ...
  • 143
1 vote
1 answer
46 views

Python script does not run in Downloads folder

I am puzzled. My Python script has two parts. It's very simple. Part-1: Makes a new folder based on date and time. Then moves all the files into that folder. This happens once a day controlled by ...
  • 131
0 votes
1 answer
689 views

How to create a link to python3 on MacOS?

Running MacOS 13.1 (Ventura) I see that python3 is installed in /usr/bin, which I can call by running python3. However, I also want to run python3 by just calling python, so I changed to the folder /...
  • 1,608
0 votes
1 answer
52 views

Get attachments from .eml files that are not in ~/Library/Mail

I copied a large number of .eml files from Mail.app to a separate folder. Each message has two attachments: a .kmz in base64 and a .gpx in plain text. I want to get these attachments from the .eml ...
  • 3,943
1 vote
1 answer
230 views

Unable to install application on fresh Monterey 12.6.2 install (python missing)

I installed Monterey 12.6.2 on a new system disk on an upgraded iMac 12.2. One of the first steps was to install all programs. One of the applications unfortunately installs, but crashes upon opening ...
  • 667
0 votes
0 answers
171 views

Need to install a specific version of gfortran in conda environment

I need to use a Python library which requires gfortran 6.3 for OSX, but I have different versions installed: which gfortran /usr/local/bin/gfortran brew list --versions | grep gcc gcc 10.2.0 10.2.0_3 ...
  • 101
1 vote
2 answers
710 views

Upgrading Python in MacOS Monterey

I understand Python is used by the OS, and that's why here on Ask Different there are several Q/A about the subject, where answerers tell people to install Python 3.x and leave Python 2.x (used by the ...
2 votes
0 answers
171 views

Cannot get launchctl to run python script

I wrote a basic python web scraping program and am trying to get it to run automatically at 4 am every day but am having no luck. The .plist file and python code are as follows: .plist: <?xml ...
  • 21
0 votes
1 answer
73 views

(Monterey) Could System Integrity Protection be keeping Python3's "MySQL" library from loading?

The "MySQL" client interface library will not load on MacOS Monterey. The relevant traceback lines are as follows: (System is Django, latest versions of everything.) ImportError: dlopen(/...
0 votes
1 answer
227 views

How to install Pygmentize on MacOS?

I'm trying this to install pygmentize on GitHub Actions macos-12 OS: $ pip3 install pygments $ pygmentize -V However, the first command does install pygments Python package, but doesn't install ...
  • 121
19 votes
2 answers
10k views

How to make python 3.11 my default python3 with brew

I like new software and I noticed that 3.11 is available in brew, so I have installed it: brew install python@3.11 I can get a repl by running python3.11, but if I run python3 I still get python 3.10 ...
  • 360
0 votes
2 answers
3k views

Cannot uninstall Python from homebrew

which -a python3 /opt/homebrew/bin/python3 /opt/homebrew/bin/python3 /Library/Frameworks/Python.framework/Versions/3.10/bin/python3 /usr/local/bin/python3 /usr/bin/python3 I want to uninstall ...
  • 3
1 vote
1 answer
408 views

not valid for use in process: mapped file has no Team ID and is not a platform binary (signed with custom identity or adhoc?)

I'm trying to run a 3rd party application through the Spyder Python IDE. I'm able to import the code and it runs through the command line using the Terminal application but Spyder appears to be more ...
1 vote
1 answer
246 views

AppleScript application asking for permission to access Desktop after full disk access (macOS Ventura)

I created an AppleScript which executes a simple Python file. I've given it full disk access but still every time it runs it prompts a "X would like to access files in your Desktop folder" ...
  • 13
0 votes
0 answers
26 views

Strange Issue of PyCharm

My M1 MacBook Pro (2020) with 16 GB RAM has the latest version of PyCharm Professional installed on macOS Monterey. I don't know when exactly this has started happening but here is the issue I am ...
0 votes
0 answers
41 views

How to programmatically adjust keyboard backlight on Macbook Pro? [duplicate]

I want to adjust the backlight on the keyboard on a Macbook Pro programmatically. I know that it is possible to adjust the backlight in the control center, and I wonder if I can do it from either ...
  • 101
1 vote
1 answer
96 views

Strange message when running `python` or `pip` command "dyld[19439]: rebase opcodes terminated early at offset 1 of 9040

I'm using OSX. When I'm running python --version or any other command which starts with the python or pip, I get this message "dyld[19439]: rebase opcodes terminated early at offset 1 of 9040 I ...
0 votes
1 answer
62 views

How can I change the Framework path my Python file is referring?

I'm trying to run a 3rd-party application with Python. I understand that Monterey has done away with the system-installed Python 2.7, however, this application was released before Monterey. When I try ...
  • 1
0 votes
0 answers
26 views

How to stop command-W from closing iTerm2 when it's active instead of the Python plots I'm intending to close? [duplicate]

I regularly run Python scripts from an iTerm2 command window, and the scripts usually generate several plots. I have an IDE open as well. From time to time I end up accidentally closing the iTerm ...
  • 1,410
0 votes
0 answers
20 views

Missing Surname after remote User Creation

Context We have multiple macs in our office and our employees are free to use every mac that is currently unused. So every mac needs an user for every employee and every time we hire a new employee I ...
0 votes
1 answer
632 views

Two Versions of Python in Homebrew

Doing brew upgrade tells me that Python failed due to an issue with Xcode and I should brew install --build-from-source python@3.10 but then another upgrade to catch whatever depends on Python demands ...
  • 3,943
-1 votes
1 answer
3k views

How do I install grpcio on m1 Mac?

Tried with Homebrew clang version 14.0.6, uninstalled it, tried with Apple clang version 13.1.6 (clang-1316.0.21.2.5), but it doesn't compile. I don't know much about compiling C when it's going wrong....
0 votes
0 answers
1k views

ansible-core requires a minimum of Python2 version 2.7

I have an ansible playbook that updates an HTML file from local (on a Mac Mini) to an apache server. When I run it, I get .. fatal: [www.invalid.com]: FAILED! => {"msg": "Failed to ...
0 votes
1 answer
313 views

Code with open cv in python in macos: process is launched in terminal but nothing happens

I am trying to display an image using open cv and used the following code (from geeksforgeeks). However, when I run from the terminal (with zsh in MacOS 11.6.1 using Python 3.7.5 and opencv-python==4....
  • 464
0 votes
2 answers
162 views

MacVim and Python on new M1 MacBook

On a vanilla MacBook with M1 processor, I installed MacVim via Homebrew: brew install --cask macvim However, when running :python import sys; print(sys.version) inside MacVim, I get: E370: Could not ...
0 votes
1 answer
262 views

Why are there two versions of Python 3 (3.9 and 3.10) on my MacOS Monterey system?

A few months ago, MacOS (currently 12.5.1) update installed the latest Python 3.10 on my system in, /usr/local/Cellar/python@3.10. It seems it didn't remove the 3.9 though, since I also have /usr/...
  • 191
0 votes
1 answer
135 views

Why does Finder not search Python (.py) files for content?

I want to search all my .py files for a certain expression, but it seems that Finder does not look at their content. Is this normal? What can I do? (This question was also raised here.)
  • 409
0 votes
1 answer
814 views

Will my Python script still run while screen saver is on?

If I'm running a Python script locally on my MacBook Terminal prompt (MacBook Pro Laptop running on BigSur) and the computers screensaver comes off while it's idle, will my script still run? What if ...
0 votes
1 answer
52 views

Alternative installation of recent Julia 1.7.3 without MacPorts

Usually, I used to install software on High Sierra via MacPorts. Unfortunately, the port Julia V1.7.3, is broken recently such that a standard installation via sudo port install Julia does not work ...
  • 167
1 vote
1 answer
720 views

File not found error : Unable to access serial port (connected to webcam) in jupyter lab (browser) - in MacOS Monterey

import serial from serial.tools import list_ports from serial import Serial port = list(list_ports.comports()) for p in port: print(p.device) ser = serial.Serial( # Serial Port to read ...
1 vote
2 answers
923 views

Multiple versions of the same Python installed

I installed Python3 via brew: brew install python@3.9 And following the symlink chain of which python3 leads to: $ which python3 /usr/local/bin/python3 $ ls -l /usr/local/bin/python3 lrwxr-xr-x 1 ...
0 votes
0 answers
157 views

Error ModuleNotFoundError: No module named 'timewheel' python

I have installed timewheel and also timewheel-scheduler on my mac. Trying the following https://pypi.org/project/timewheel-scheduler/ However I am encountering the following error from timewheel ...
  • 1
0 votes
0 answers
103 views

Importing Python modules at MacOS 12.4 from a script

On my MacOS 12.4 is Python pre-installed, in the version Python 3.8.9. I did nothing for that, neither changed pathes. If I run a Python script, which needs some modules with import requests or from ...
  • 143
1 vote
2 answers
841 views

Can't `pip install p4python` on Apple Silicon

I recently upgraded my system from an Intel Mac to an M1 Pro. I need to use p4python module. I installed Python 3.7.13 using pyenv which I installed using Homebrew. All Apple Silicon native. When I ...
  • 61
6 votes
1 answer
800 views

Python Script Using Efficiency Cores Rather than Performance Cores in M1

I am using moviepy to automate clips to make a video. I am using python 3.10. When I run from pycharm, it is using performance cores to render my videos. But when I moved to crontab to schedule this ...
0 votes
1 answer
42 views

Recover and deduplicate Time Machine backup files

I have an old Time Machine backup and would like to recover the latest version of the files without restoring the backup to a whole computer. For example, say that the Time Machine backup drive has ...

1
2 3 4 5
12