Questions tagged [python]

Python is a programming language that is included in the standard macOS installation. If you have any programming questions about Python, ask them on Stack Overflow.

Filter by
Sorted by
Tagged with
5
votes
1answer
265 views

Using Raspberry Pi as a home hub for Apple HomKit setup

I'm trying to make my home a bit smarter using HomeKit without actually buying HomeKit accessories. Now I'm using python and the pyhap libary and it is working so far. I can control my Raspberry Pi ...
0
votes
0answers
16 views

Similar video finder app/script/solution

I have a videos folder, which has a bunch of duplicates. Problem is your average duplicate file detector apps can't detect these, because the videos are not 100% identical (the videos will have 20 min ...
0
votes
0answers
25 views

What does “link: false” mean in my Brewfile?

My Brewfile created with brew bundle dump contains one line with link: false: ... brew "git" brew "python@3.8", link: false brew "glib" ... I don't see any kind of --...
65
votes
6answers
116k views

How to install specific version of python on OS X

I need to install python3.4 on my OS X. Tried to do it with brew install python3 and now I have python 3.5.1. But I need py3.4. How can I install python3.4 on my Mac?
19
votes
5answers
36k views

How to add permanent environment variable in zsh

I have been scouring the internet, and cannot seem to find a solution to permanently adding an environment variable, specifically when my OS is macOS Mojave (10.14). It seems there are a lot of ...
2
votes
2answers
78 views

What causes excessive CPU use by taskgated, notifyd, and launchd processes?

I've looked around a lot to try to find the answer to this but have thus far been unsuccessful. I am programming in Python, and I have code that takes a long time to run (hours to months depending on ...
0
votes
1answer
47 views

How to install Anaconda python for multiple or all users?

How to install https://www.anaconda.com/products/individual not just for Administrator? I was trying to install it from GUI but installation for all users was disabled:
1
vote
2answers
58 views

Why does my zsh program run fine in terminal, but not as an automator app? [duplicate]

I got a mac last week and am trying to learn the basics by coding a few projects I came up with. I've been creating a few apps I can place on the dock that automate simple functions that I use often. ...
0
votes
0answers
35 views

Cannot find my Miniconda Python installation after switching from bash to zsh

Recently after upgrading to Catalina, the terminal changed from bash to zsh, and I lost my Python installation. My Python was installed with Miniconda, but now I can't find it anymore, I can only see ...
0
votes
1answer
19 views

which certificate/identifiers/profilers should be used for python script to be distributed as a pyinstaller build/bundle outside the app store?

My program works as follows In a while loop, it checks for the active window change - AppKit library used from AppKit import NSWorkspace active_window = (NSWorkspace.sharedWorkspace()....
3
votes
2answers
49 views

Why is pip3 referencing Python 2 instead of 3?

When I try to install Python pacakges using pip3 on macOS (Catalina) it searches Python 2 instead: vger:~(61)+>- sudo -H pip3 install xattr DEPRECATION: Python 2.7 reached the end of its life on ...
0
votes
1answer
32 views

LaunchAgents runs Python script in version 2

Maybe someone can explain this. I'm having LaunchAgents run a Python script on startup. The relevant part of the plist looks like: <key>ProgramArguments</key> <array> <string&...
80
votes
7answers
133k views

Homebrew: Rollback from Python 3.7 to Python 3.6.5.x?

A brew upgrade upgraded my system Python to Python 3.7. Unfortunately, Python 3.7 breaks other software I need to use (including but not limited to Ansible). I imagine these problems will be worked ...
1
vote
3answers
407 views

How to install python3.7 on a mac (mojave using homebrew

I am running MacOS Mojave (10.14.6) and want to install python 3.7. Currently I have python 3.6 installed: $ python -V Python 3.6.9 There seems to be python 3.7 available: $ brew search python ==> ...
0
votes
0answers
19 views

Pyglet not working on MacBook

I have installed Pyglet on my mac for python 3.8 but it isn't working . By that I mean when I type pyglet.font.add_file('DIN Next W01 Light.ttf') to add that font into my file it shows an error No ...
0
votes
1answer
28 views

Why does Python keep popping up and occupying my CPU?

I occasionally get Python popping up and occupies all my CPU I have no clue why this is happening, because I almost never run Python on my laptop.
7
votes
3answers
6k views

Why is 'xattr' not working?

When I attempt to execute xattr in Terminal, I get Traceback (most recent call last): File "/usr/bin/xattr-2.7", line 33, in <module> import xattr ImportError: No module named xattr What'...
0
votes
2answers
3k views

How run a .py (python?)-script in Xcode?

Hi I got the complete code, but I don't know how to run the script. The script is some plot of a function, can one run the script so that the plot is shown in xcode?
1
vote
1answer
85 views

Maxima and Jupyter - will Homebrew work?

I'd like to give Maxima a try in a Jupyter notebook on my Mac. Is the Homebrew version of Maxima up to the task? I did try following the instructions at https://github.com/robert-dodier/maxima-...
0
votes
1answer
28 views

Python launcher Icon every time a script runs

I've had a MacBook given to me from work for over a year now and recently I got a new mac and every time I launch a python script the python launcher icon appears in the mac dock. However, in the old ...
-1
votes
2answers
47 views

Updating python on macOS

Its usually not recommended to update a system package (such as python) on macOS. However, I have been asked to upgrade to test something. So now the question is - how hard it is to update python on (...
0
votes
0answers
6 views

Unexpected behavior with php in Catalina + Apache2 — classic “phpinfo.php” script produces a “Save” dialogue box, but no error msgs

I am using the default installations of Apache2 and php7 that came with Catalina on a Mac AIR. I am trying to run the classic phpinfo.php script: <?php phpinfo.php ?> My https.conf file ...
2
votes
2answers
172 views

How to code-sign my python script / package packaged for mac using pyinstaller without using xcode?

I have written a python script and bundled it using the PyInstaller. The executable file inside the dist folder works fine on my Mac. But not on someone else's Mac even if they've set "App Store ...
3
votes
1answer
522 views

Can't run python script from Automator on Catalina “Operation not permitted”

I have a service in Automator that I pass a folder and it runs on every file in the folder. It uses a python script to read the album field from an mp3's id3 tags and write it to the Finder comment ...
0
votes
0answers
9 views

why python 2.7 doesnt pick pyqt4 installed using homebrew

I needed to fix the application before I migrate it to pyqt5, so I installed pyqt4 using brew: brew install cartr/qt4/pyqt now when I tried launching pyqt4 app I still get this error: Traceback (most ...
0
votes
0answers
14 views

How to make script run on system start/user login via terminal [duplicate]

I have Mac OS PC, let's name it PC1, and I have Linux PC (PC2), on Mac os PC I have python script(reverse shell), I need to make it run on system start or user login(no matter) threw terminal, I have ...
0
votes
1answer
31 views

Facing problem to test Energy Consumption by a factorial function with Python module “pyRAPL”

I would like to calculate energy consumption. That's why I have used the following program, unfortunately it gave errors. MWE: #need python3.7 to run this from math import * import time # time ...
0
votes
0answers
12 views

Command + W has stopped working for python app

I'm working on a matplotlib Python application to draw graphs (MacOS Catalina 10.15.5). I was able to close the window using Command + W but recently that doesn't seem to work. The shortcut works with ...
1
vote
0answers
42 views

Failed to import cxutils module into Python

I had been using Crossover for a while on High Sierra (10.13.6) without any problem but recently, I needed it again and tried to install it again but encountered a very annoying error. Looked for a ...
12
votes
4answers
4k views

Using pip vs. MacPorts for installing Python packages

I could install a python package (for example, numpy) on my Mac either via Macports: port install py-numpy or via pip: pip install numpy What are the general pros/cons of each approach? When ...
0
votes
1answer
36 views

My Mac Book Pro switch between charge and not charge when running a long program

When I am running a very long program (e.g. A long python script) and when I plug in the charger, my laptop will switch between charging and not charging very frequently. However, if I stop that ...
2
votes
1answer
77 views

Python with Catalina : No module named 'OpenGL'

I am running the examples provided by the PyQtGraph python graphic module, on a MacOS Catalina. They all work fine for me, except those in 3D. I have a message : Traceback (most recent call last): ...
0
votes
0answers
19 views

Failing to connect Python to MySQL — no luck with brew install mysql-connector-c

I think I must have made some mess with brew install/uninstall of MySQL, but I don't know how to get out of this state: I'm trying to run MySQL stuff on Python 3.7 (High Sierra 10.13). However: ...
3
votes
4answers
1k views

Levelator working with Catalina?

One big app that we use constantly and is arguably the best (free & simple) tool to automatically adjust audio levels for podcasts and any kind of recording is Levelator. There's simply no ...
17
votes
2answers
9k views

Is /usr/bin/python3 provided with macOS Catalina?

Is /usr/bin/python3 provided with macOS Catalina?
0
votes
0answers
51 views

Python3 script runs fine in Terminal but not as a crontab job

Using an iMac, Catalina. Recently changed ISP and need to know when feed was swapped over. New to Python scripting. I managed to get this running in Terminal, But not crontab. Crontab reads:- @reboot ...
0
votes
0answers
464 views

How to Install NLTK for Python3 on Mac [duplicate]

I am trying to use NLTK and am able to do so using python2.7, but I am unable to use it with python3 (i.e. when I type import nltk, I get the following error message: ModuleNotFoundError: No module ...
0
votes
1answer
36 views

What's the `darwin` in Mac?

In my Mac I execute the code: import sys print(sys.platform) then get darwin, why it is not OSX. I don't know where to look for documentation on python sys module. What's the darwin ?
30
votes
3answers
44k views

Do Terminal processes stop if Mac sleeps?

I'm running some Python machine learning programs through Terminal that take hours at a time to finish. If I leave my computer unattended it hibernates - the screen goes off and I have to type in my ...
0
votes
3answers
2k views

Re-install Python on macOS

I uninstalled Python on my Mac by moving all python-related files in my Mac (including system files) to the trash and emptying the trash. Now, I can't get Python 3 to work at all (despite reinstalling ...
0
votes
2answers
1k views

Unable to open serial port using simply python script on macOS Catalina: [Errno 16] Resource is busy

On a brand new MacBook16 running Catalina (10.15.1) I am getting the following error trying to connect to an FTDI FT232R USB UART device. Python 2.7.17 (v2.7.17:c2f86d86e6, Oct 19 2019, 16:07:15) [...
0
votes
1answer
27 views

How do I get Apache to use the default pyenv Python version instead of the system one?

I am using plain Apache 2.4 on Mac OS Catalina. I installed pyenv to manage python versions. The default Python is 3.8.0 Now I try to have Python scripts running in Apache. I created a subdomain ...
1
vote
1answer
104 views

How to view real time dynamically updated information on thermals and fan speed through the terminal?

Is there any way to view real time fan speed and thermal information (CPU, GPU) through the terminal, such as by installing an application with homebrew (i.e. $ brew install ...) or python (i.e. $ pip ...
1
vote
1answer
44 views

How do I install python pyRAPL module on MacOS?

How do I install python pyRAPL module on MacOS high sierra 10.13.6? The following errors are coming up whenever I try to install. How do I solve it?
0
votes
0answers
15 views

Automator service to transform outlook reply body

I'm trying to create a macOS service (in python, preferably) that would allow me to change the rich-text body of an outlook message I'm editing. If I set the service script to receive rich text, it ...
1
vote
1answer
773 views

How can I determine the sound volume from within a python script?

I need to see when the sound volume on my Mac hits a certain point, in Python (and preferably without the need of any permissions). Any pointers appreciated.
1
vote
1answer
33 views

Stop installing python for each package by brew

I have installed python on Mac by Anaconda. Here is the path : /Users/USERNAME/anaconda3/bin/python /usr/bin/python But when I want to install any package that need python, it installs it separately....
0
votes
1answer
225 views

Youtube-dl is returning errors when grabbing from Mixcloud

In short - I thought my earlier Python 3 enquiry would solve my problem with Youtube-dl but it didn't. I am working through a reddit enquiry I put in a couple of weeks ago and am now a bit stumped: ...
1
vote
1answer
60 views

Pip cannot install packages after upgrading to Catalina

I haven't used pipenv since upgrading, but today I needed to work on an old project and I'm getting problems with pipenv and other python utilities. I did a xcode-select --install and brew update &...
2
votes
1answer
636 views

Python quit working and now I get “Illegal instruction: 4” message

I have an old iMac running High Sierra and I use the Anaconda distribution of python 3.7. I've been using Anaconda for over 2 years and it has worked fine. I have a test code I've run over 100 times ...

1
2 3 4 5
10