Skip to main content

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
0 answers
29 views

Python symlinks not working as Finder aliases

I'm writing some python code in JupyterLab and want to make symlinks that work in the Finder as aliases. But using the Python os.symlink command doesn't work as an alias. The Finder treats the ...
avirr's user avatar
  • 101
1 vote
1 answer
39 views

How to create a new iTerm2 with a keystroke and bring just this window to front

I've searched for quite a while now, I talked to numerous artificial intelligences, real intelligences and I tried many things including apple script and iTerms python API. But it seems impossible to ...
Daniel's user avatar
  • 11
0 votes
1 answer
30 views

Manage python environments with MacPorts

In win I was using anaconda and with conda activate I could easily manage isolated python environments that I can then used in any IDE etc. How can I do the same with MacPorts? I know anaconda is also ...
myradio's user avatar
  • 103
0 votes
0 answers
24 views

visual studio keep ask repeatedly to install command line tools

in visual studio, whenever i want to run my python code, the terminal always say :dangtruongan@Ans-Macbook-Air ~ % python -u "/var/folders/xb/q6y456rd0wb3y1h6ht5qpth00000gn/T/tempCodeRunnerFile....
Trường An's user avatar
0 votes
1 answer
26 views

Various installations of python on my MacBook

I am doing more or less a find . -iname "*python*" -type d in my MacOS and I find numerous python installations. I am unable to figure out which is which and what is its purpose so I was ...
pkaramol's user avatar
  • 145
0 votes
0 answers
71 views

Learning Python, can't install scikit-learn

On my Windows machine, I ran pip3 install scikit-learn and it installed without any problems, however, on my Mac, I've tried a lot of things: $ brew list ...
ohshitgorillas's user avatar
1 vote
2 answers
50 views

Newly installed python 3.12 is overshadowed

I have a working python version - python3 --version gave Python 3.9.6. Then I used homebrew to install python 3.12. It is located in /opt/homebrew/bin according to the homebrew installer. If I run ...
peterparker's user avatar
0 votes
0 answers
21 views

Cannot import openbabel into python

I am trying to use openbabel within python in macOS BigSur, I have installed openbabel and py310-openbabel through macports without any problem, however when I run python3.10 I get the following when ...
SwatchPuppy's user avatar
0 votes
1 answer
32 views

Python can't access Keychain when executed through SSH but it works from a local terminal?

I use Pushbullet CLI to send Pushbullet pushes from the terminal. It works fine when I execute it locally but when I ssh into the machine where it is installed and try to send a push I get a Python ...
d-b's user avatar
  • 3,358
-1 votes
1 answer
333 views

How to fix ImportError: dlopen(): symbol not found in flat namespace '_mysql_affected_rows' on Mac M1

I am having an issue with running a script within a python virtual environment. I have installed MySQL, MySQL client, Django, and everything using Homebrew since I am on a Mac M1 (Apple M1 Pro running ...
sparticat's user avatar
0 votes
0 answers
214 views

Can't install libmagic on Mac M1 Pro

I am having significant trouble installing some Python libraries/dependencies for a project I have to work on, specifically with libmagic. I have tried to install libmagic several ways with no success ...
sparticat's user avatar
2 votes
1 answer
490 views

Installing Python 3 on legacy MacOS (10.15 Catalina)

I am trying to update python on my MacBook Pro 2013, but I can’t seem to get anything to work. Brew and Macports both don’t support MacOS this far back and Xcode won’t update because it’s to old. Is ...
ArrowSwift's user avatar
1 vote
2 answers
106 views

How to prevent MacBook from going to sleep when running tasks?

I'm running some python scripts for many hours and my MacBook Pro Keeps trying to go to sleep (I think). I am not sure if going to sleep is the proper term. Essentially what happens is that after a ...
poupou's user avatar
  • 43
1 vote
1 answer
82 views

How to install official python releases in MacOS without using the GUI

How do I install the release from python.org on my MacOS? I downloaded the latest release of Python from the official website, verified the PGP signature, and now I want to install it -- but how? user@...
Michael Altfield's user avatar
1 vote
1 answer
121 views

Why is brew trying to install a dependency that is already installed?

Why does brew attempt to download a dependency (and fail) when that dependency is already installed? I'm trying to install a python bottle from homebrew on a system that does not have Internet access. ...
Michael Altfield's user avatar
0 votes
0 answers
26 views

How to force brew to install from local bottle (without git clone github.com/build/homebrew-deps)

My goal is the have brew skip trying to make calls to the Internet when installing local cached bottles. I have downloaded the brew bottles for python and the python module virtualenv. user@host ~ % ...
Michael Altfield's user avatar
0 votes
1 answer
164 views

python doesn't see package installed by brew

I have Python installed with brew and I cannot import a fontTools package even though it is installed in brew. I only have this one Python version on my computer. Any ideas why it is not linked? I am ...
Marek's user avatar
  • 1
0 votes
0 answers
21 views

broken python3 and pip on macos sonoma [duplicate]

recently i tried to install a python package for example boto3 on my mac but i get this error error: externally-managed-environment × This environment is externally managed ╰─> To install Python ...
Kiumars Javan's user avatar
0 votes
0 answers
20 views

Homebrew: Install formula with Python bindings for specific Python version?

I'd like to install a Homebrew formula that has Python bindings. OpenImageIO is an example: brew install openimageio As of this writing, the version of Python that Homebrew is wanting to install is 3....
Ned W.'s user avatar
  • 341
1 vote
2 answers
236 views

Problems with Python on macos Ventura

So I updated my mac a while ago to ventura 13.3.1 and ever since it messed up my python path, I can't use Pycharm (it can't locate a valid interpreter path), and I can't use pip as well. When I try to ...
ClovisIRex's user avatar
2 votes
1 answer
449 views

Yet another issue with a homebrew update => python upgrade => "No module named 'praw'" (missing site-packages)

Sorry for the repeat, if any, but this is driving me nuts. I ran through a few upgrades of homebrew, in the past, and all python scripts I used to use were running fine, post python updates, meaning ...
Papi Antoniadis's user avatar
1 vote
0 answers
116 views

How do I communicate with a host USB device through Mac's Terminal?

I have a Siglent SPD3303X-E power supply that I am attempting to interface with. I am running a Macbook Pro with OS Sonoma 14.3.1. I've read online about what SCPI commands to send to the power supply,...
JenkelandTonic's user avatar
0 votes
0 answers
195 views

After running `brew upgrade` in macOS 14.3, I got this error while installing numpy: 'Error: The `brew link` step did not complete successfully...'

The full error message is: ==> Pouring numpy--1.26.3.arm64_sonoma.bottle.1.tar.gz Error: The `brew link` step did not complete successfully The formula built, but is not symlinked into /opt/...
clarkb86's user avatar
  • 131
1 vote
2 answers
252 views

Python subprocess.run fails with CalledProcessError on Mac but works on Windows

I have a script file subprocess-script.py as follows: import subprocess import platform command = [] exe = "path/to/myapp.app" input = "/path/to/in.ext" output = "/path/to/...
Harry McKenzie's user avatar
0 votes
1 answer
117 views

xattr: bad interpreter: No such file or directory

When I execute the xattr command, it returns the error: /usr/local/bin/xattr: /usr/local/opt/[email protected]/bin/python3.11: bad interpreter: No such file or directory file /usr/bin/xattr returns: /usr/...
RHPT's user avatar
  • 708
0 votes
1 answer
75 views

Python and pip incompatible

I've installed python via Macports and have now Python 3.12. (MacOS 11 comes with Python 3.8) When I run pip3 --version I get this: /Users/ingmar/Library/Python/3.8/lib/python/site-packages/pip (...
user1785730's user avatar
-3 votes
1 answer
71 views

Does Apple deploy Python3 with Ventura out of the box?

A new MacBook was acquired with Ventura last May. I immediately began to install a list of apps via homebrew. When I unboxed the Mac, I did NOT check to see if Apple outfitted it with Python (be it ...
gatorback's user avatar
  • 3,071
1 vote
4 answers
2k views

How to confirm MacOS "system" Python version

MacBook Pro outfitted with Ventura 13.2.1 It is my understanding that "system" python: macOS Catalina or later is deployed with Python3.x removing system python is fatal / requires OS to be ...
gatorback's user avatar
  • 3,071
0 votes
0 answers
43 views

Intel Conda installation on macbook pro : changing the name of environment from "root" to "base"

I have recently installed Intel conda on my macbook pro Sonoma and I have an issue when I list the different available environments of conda : $ conda env list # conda environments: # 2022.2.0 ...
guizmo133's user avatar
2 votes
0 answers
44 views

How can I ensure that Excel can import my pip-installed python libraries?

I have a script that imports Selenium WebDriver and it runs fine in VisualStudio debugger but fails when I call it from an Excel module because it can't find the Selenium module. Here's the code stub:...
Phil's user avatar
  • 31
0 votes
0 answers
50 views

How can I fix a script that allows to import selenium in Python debugger but not when I call the script itself?

I wrote a Python script to use Selenium to open FireFox and scrape stuff off a web page. Here's the minimal version of code that works in the debugger. from bs4 import BeautifulSoup import sys import ...
Phil's user avatar
  • 31
0 votes
0 answers
149 views

Cannot get matplotlib to work on M1 mac

>>> import matplotlib Traceback (most recent call last): File "<stdin>", line 1, in <module> File "/Users/danielbak/venvs/hw-ble-venv/lib/python3.9/site-...
Daniel Paczuski Bak's user avatar
0 votes
0 answers
35 views

How to Bypass or Automate MacOS Software Check from Python

I have a python script running on MacOS that uses Selenium chromedriver. I use chromedriver_autoinstaller to check for and install the latest chromedriver automatically. The problem is, on MacOS, ...
torJamlite903's user avatar
0 votes
0 answers
242 views

PyQt5 ImportError on M2 MacBook Pro

I'm trying to install a tool with Python 3.11 under macOS Ventura after exchanging my old MacBook Pro (Intel) for a new M2 MacBook Pro. When trying to start the tool, I encounter this error: ...
Albireo's user avatar
  • 11
1 vote
1 answer
59 views

Could not build wheels for turiassetstore

I'm using Anaconda environment and trying to install turiassetstore library with the following cmd: pip --verbose install turiassetstore==0.9.7 -i https://pypi.apple.com/simple \ But I get the ...
Sal's user avatar
  • 13
0 votes
0 answers
38 views

Why Stable Diffusion model in .mlpackage not need 'vocab.json' and 'merges.txt' but .mlmodelc need?

ml-stable-diffusion image generation using python with .mlpackage format stable diffusion models. And there is neither 'vocab.json' nor 'merges.txt' file in the folder. But if generating images using ...
timyau's user avatar
  • 131
1 vote
0 answers
100 views

How to staple Apple notarization tickets (without using 'xcrun stapler')

Recently (as of 2023-11-01) Apple has changed their notarization process. I took the opportunity to drop Apple's own tools for this process (notarytool) and switch to a Python-based solution using ...
umläute's user avatar
  • 113
0 votes
0 answers
118 views

How to use python3.12 as the default version in macos? [duplicate]

I recently updated to python3.12 because I needed the newest version for ProperTree to work correctly. I installed python3.12 with brew install [email protected] and then ran which python3, which outputs /...
Emanuel Berger's user avatar
1 vote
1 answer
196 views

How to run python script from remote?

I do have a python script which I am using locally in Terminal, works great. It makes use of Apple's iCloud / credentials so it must be run on my Mac. Now I need to run the script from remote (a ...
Døner M.'s user avatar
  • 113
0 votes
1 answer
506 views

Should I set PYTHONPATH for the pre-install python on MacOS 13 M1/M2?

On the new MacOS 13 M1/M2, python 3.9 is pre-installed with pip3 (no pip). I don't install other Python versions with brew/macport or Python installer, only the pre-install 3.9. With the pre-install ...
Qiulang 邱朗's user avatar
2 votes
0 answers
103 views

launchd job returning 2 but works fine in terminal

I'm trying to write a bash script to clean up my Downloads folder every day at a certain time. The bash script should get called then a python program afterwards to do the cleanup. I'm using launchd ...
A-A's user avatar
  • 21
2 votes
0 answers
234 views

Configure poetry to create x86 environment

TLDR How can I configure poetry to use/create an x86 environment? Details My python project has a dependency that is not available for apple silicon (I use a Macbook Pro M2). A plain pip install will ...
ElRudi's user avatar
  • 183
1 vote
0 answers
98 views

Why is mac able to find some bin in PATH but not others?

I recently upgraded Python but encountered some strange behavior: I have both /opt/homebrew/bin and /usr/local/bin in my PATH variable. python was in both these directories. When I removed the one in /...
ron burgundy's user avatar
0 votes
0 answers
16 views

Can i run a python file/vscode in sleep mode [duplicate]

Can Macbook Pro M2 run a Python file / VScode in sleep mode?
bear's user avatar
  • 1
1 vote
0 answers
71 views

Unable to send compressed zip file from a Mac

I was given a Google link to upload a zip file containing some python scripts and screenshots. But for some reason I wasn't able to click on the required zip file when the Finder opened up, but I was ...
singleslit's user avatar
0 votes
0 answers
35 views

Why am I getting two different formats from Automator Workflow Get Variable Value

I have an Automator Workflow that runs an AppleScript where the operator chooses one of three option from a list {"Move Staff", "Move Retouch", "Move Grade"} A Set Value ...
JBS's user avatar
  • 45
0 votes
0 answers
33 views

Titlebar Changing on opening MacBook Air M1 terminal

On opening the terminal on my MacBook Air M1, the following happens.See link The terminal titlebar changes from login to python to zsh. i dont understand how python is getting echoed. zprofile export ...
Kartikey Doshi's user avatar
0 votes
0 answers
67 views

Python script unable to access external drive under cron

My desired cron job consists of a bash script that does the following: Create a new Python environment (with a new python executable) Use that Python executable to run a Python script, which accesses ...
Michael Jan's user avatar
0 votes
0 answers
17 views

Running Python script with a keyboard shortcut in automator [duplicate]

I've written an auto mouse clicker script in Python that clicks on chosen parts of my screen when the script is run. I'd like to be able to do this quickly and repeatedly so want to be able to run it ...
andyflanagan47's user avatar
2 votes
1 answer
600 views

How to fix broken symbolic link in an M1 Mac?

file /Users/gani/.local/pipx/venvs/aws-sso-util/bin/python /Users/gani/.local/pipx/venvs/aws-sso-util/bin/python: broken symbolic link to python3.10 Here is more info: ls /Users/gani/.local/pipx/...
Bear Bile Farming is Torture's user avatar

1
2 3 4 5
13