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

How to property uninstall Python 3.7?

I'm trying to build a package but would like to uninstall Python 3.7 from my machine first. The build appears to think /usr/local/opt/python/Frameworks/Python.framework/Versions/3.7/Python exists on ...
1
vote
2answers
244 views

How to execute python script by terminal?

I wanted to learn Python, I installed some software. I created a little execution files and none of them will execute. So I've checked my terminal and type basic things like Is, cd etc. None of them ...
0
votes
1answer
22 views

What do these marks indicate exactly on these tray icons when I run Python from a terminal?

I ran an Anaconda Python installation from iTerm using python -i myscript.py. It made a plot using Matplotlib. After I closed the plot, the two icons remain. Each has a dot under it, and a little ...
4
votes
0answers
40 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
13 views

python mac os app pyqt4 dependency import error

getting this error while trying to launch python app dependent on pyqt4 Traceback (most recent call last): File "/Applications/Gallery.app/Contents/Resources/scripts/gallery", line 16, in <...
0
votes
1answer
25 views

Access to ioreg using Python?

Is there a way to access the values ioreg utility accesses via Python? What i'm looking is to add monitoring of the battery status of my Magic Mouse. I know I can get it by using ioreg -c ...
1
vote
1answer
21 views

Python interactive mode not registering changes made to file on disk

I am running Python 2.7 in interactive mode in Terminal. If I make changes to the Python source or data file while the same is open in Python prompt, it doesn't appear to see the change, and exhibits ...
0
votes
0answers
24 views

How to make AppleScript ignore escape characters in string to make a Note

I have a python script that takes a user's input and inserts it into the name and body parameter of the make new note apple script. The problem is that any escape or special characters get interpreted ...
1
vote
0answers
32 views

Getting OCRmyPDF to work with PDFMiner

I'm trying to get OCRmyPDF to work on my Mac. I installed it successfully by running: brew install ocrmypdf But when I tried using it by running: ocrmypdf --redo-ocr input.pdf output.pdf I get ...
1
vote
2answers
54 views

Which macOS tools require Python 2 (rather than Python 3)? [closed]

macOS comes with Python 2 installed, which is presumably because some tools the OS uses are not compatible with Python 3, as suggested by the answers to this Quora question. Which tools/programs pre-...
1
vote
1answer
52 views

Running Java / Jython process in the background

I am trying to run a Jython script in the background. This is what the script looks like, a_jython_script.py for i in range(10000): print i When I try to run it in the background, it is ...
0
votes
0answers
42 views

Tcl-Tk Homebrew install with X11 support

I am trying to modify the tcl-tk Homebrew formula to have tk installed with x11 instead of the default aqua. However I haven't been able to do it so far. Can anyone help? This is the tcl-tk.rb: ...
0
votes
0answers
23 views

Intercept Macos notifications

I would like to create an App (Python or whatever language) that would be able to "intercept" other apps notifications before they appear and sometimes block them. Do you known if it is possible ? I ...
7
votes
2answers
2k views

When updating to macOS Catalina will the default Python installation get removed from my system?

Apple will stop shipping scripting languages like Python with macOS starting with Catalina. When I eventually update to macOS Catalina, will the Python (2.7.X), which currently ships with macOS get ...
4
votes
2answers
105 views

How to get rid of Python Launcher icon every time a script runs?

Using Sublime Text 2 or Atom (maybe other editors too), when running a simple plotting script in Python, the Python Launcher icon (the rocket) pops up every time I run the code. The icons add up in ...
0
votes
0answers
32 views

Using automator with python script that requires user input during Spotify API authentication process

I have a script that gets name, artist, and spotify ID of the currently playing song, and add the track to a pre-defined spotify playlist. To make the process of running the script a bit easier, I ...
0
votes
1answer
81 views

Why isn't a binary not being found in my PATH?

I've got a Python project which uses a virtual environment. In my project folder, there is a bin/ folder which contains all the executables needed by the project. To use these, you run source bin/...
1
vote
0answers
67 views

Missing Messages from chat.db

Hi so I can't currently create a minimum reproducible example but I am missing texts that I know I sent and appear in the search on the iMessage app but aren't in chat.db My python code below import ...
1
vote
1answer
495 views

Unable to install python mysqlclient - OSError: mysql_config not found

I installed mysql through XAMPP. When I try pip install mysqlclient I get this error MBP-of-admin:django_project aanto$ pip install mysqlclient Collecting mysqlclient Using cached https://files....
1
vote
1answer
120 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
0answers
91 views

Failing to install the package “Pygments” with brew

I'm try to use the minted package in latex to display code in latex document. I get an error message "you must have pygmentize installed" to use this package. So I tried to install the package ...
2
votes
3answers
3k 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 ...
4
votes
0answers
369 views

Pip Installed Tools: “command not found” | Homebrew Installed Python Tools Work Fine

I installed Python 3 with Homebrew and a tool I was installing through Homebrew auto-installed Python 2.x. So, I have both and pip (etc) is installed for both, unlike the macOS default Python. ...
1
vote
1answer
760 views

What does Python Launcher do?

When download python from https://www.python.org/ and install it, I saw 2 apps installed, it is easy to see the purpose of IDLE but I am confused with the purpose of Python Launcher. What does Python ...
1
vote
2answers
142 views

How to set the python environment for LaunchDaemons

I have installed Python 3 via Homebrew, on my Mojave system, and have it symlinked to /usr/local/bin/python. I have a LaunchDaemon plist as follows: <?xml version="1.0" encoding="UTF-8"?> <!...
4
votes
0answers
30 views

Is there a script/cmd that I can create/run that will allow me to install .dmg? [duplicate]

I have been working on a "Mac Rollout Project". After I run the Macs through the Apple setup, I have a list of .DMG / Applications that I have to install. There is no particular order that the .DMG / ...
1
vote
1answer
27 views

Path of an application (here Python) is not accessible from the Finder

I cannot see in the Finder the path "/Library/Frameworks/Python.framework" (there is no folder "Frameworks" inside "Library") although this path is the output of the error message when trying to run a ...
1
vote
1answer
58 views

Deleting empty Directory with File's Ghosts?

I am trying to delete bunch of directories appearing to be empty amr@MacBook ~/folders> ls -la -R total 24 drwxrwxrwx 6 amr staff 192 Mar 9 14:37 . drwx---r-x+ 40 amr staff 1280 ...
1
vote
0answers
166 views

When using Jupyter Notebook, can't read files on desktop

No matter what Python approach I take to reading a file on the MacBook Pro desktop, I get a 'path does not exist' error message. In Terminal, I find that a web of directories was created where ...
1
vote
0answers
73 views

Programmatically importing pictures to Apple Photos and modifying Exif data

[I was suggested to post this here instead of StackOverflow. ] How do I programmatically import picture files to Apple's Photos app? The reason for this is that I have 20,000 old pictures. Most are ...
1
vote
1answer
35 views

avoiding python@2 redundant dependency

I installed gdal using homedal because I need it for ortho4xp, which uses python3. I noticed that gdal depends on both python and python@2. Gdal is not the only package doing this. It pulls in numpy, ...
2
votes
1answer
29 views

Disable vertical quote bar?

Mail.app's vertical bar formatting of replies is usually useful. I have one annoying case that comes up very frequently for me that I have been trying to find a solution for. I am a Python ...
1
vote
0answers
39 views

How to create additional groups using MacPorts?

I've installed both pip (pip27) and pip3 (pip37) for Python. However, MacPorts has only created one group called "pip" that can either be set to pip27, pip37 or none. I want pip27 to be available as ...
0
votes
2answers
181 views

How do I find out (command line or python) if an IP address is from the local host?

I am running macOS High Sierra and Mojave. I'd like to be able to find out (for a python script) if some IP address is from the local machine or another machine. The local machine may have multiple ...
5
votes
3answers
950 views

Can I update to python3.7 from python2.7 in my macOS 10.14.1?

I have macOS 10.14.1. I installed Python3.7 but can see that python2.7 already installed in my os. Can I remove 2.7 and just keep 3.7? Will it affect other apps?
1
vote
2answers
214 views

Old python script not working on mac - needs tkinter

I'm running mojave 10.14.2 I typed this into terminal python -V and got Python 2.7.10 I use 3D software called poser, and I had some amazingly useful scripts for this that i bought. There is one in ...
0
votes
0answers
400 views

How to install from an url with hombrew?

I would like to install a specific version of python3 (python 3.6.8) on my macbook. I tried to: brew install https://www.python.org/ftp/python/3.6.6/python-3.6.6-macosx10.9.pkg However, it doesnt ...
1
vote
1answer
244 views

ModuleNotFoundError: No module named 'numpy' when installing robotpy-cscore

When using pip to download robotpy-cscore on my Mac, I ran pip3 install robotpy-cscore However, I got: Collecting robotpy-cscore Using cached https://files.pythonhosted.org/packages/3e/2a/...
3
votes
1answer
3k views

How to use house brew install python 3.6.5_1

I am trying to install python 3.6.5_1 using Homebrew by running the following: $ brew install https://raw.githubusercontent.com/Homebrew/homebrew-core/f2a764ef944b1080be64bd88dca9a1d80130c558/Formula/...
0
votes
1answer
35 views

Website URLs seem to refresh in the background

I have written a Python script hosted on a Raspberry Pi that controls my garage doors. The doors are operated by sending a GET request to one of a few URLs on the server. It's only available within ...
0
votes
1answer
344 views

Accessing a NAS device from Python code on Mac-OS [closed]

I have a NAS device that appears in Finder under the Shared devices so I can read and write to it just like any folder on my OSX drive with no need to provide authentication. How can I read and write ...
1
vote
1answer
568 views

Python on High Sierra “No Java runtime present, requesting install”

I have python code that works just fine in multiple other places and "used" to work on my mac, but now when I try to run my code as: python <pythonfile>.py I get an error which says: No Java ...
0
votes
0answers
81 views

How to select all iCloud photos for download in web brower?

I would like to learn how to select all icloud.com photos so that they can be downloaded via Firefox on Ubuntu and backed up on a NAS. If this is not possible (iCloud economics has incentive not to ...
0
votes
0answers
538 views

“Critically low disk space” error when running python script since upgrade to OSX Mojave

I have a problem with a python script that is getting killed due to, what I believe, low available memory but I hope is a bug. Description as follows: I have a python script that loads 12 large (1-1....
1
vote
0answers
11 views

Preview doesn't show the content of text file with a certain extension (`.jl`) in Finder [duplicate]

When looking for a script of a programm (.py for Python, .m for Matlab, .jl Julia or .txt in general) it is very handy to go in the finder a simply highlight that script file ==> then a preview of ...
0
votes
0answers
41 views

Best way to add /Users/$USERNAME/Library/Python/2.7/bin to path [duplicate]

So, I used pip install <package> to install a package. It lives in the /Users/$USERNAME/Library/Python/2.7/bin. Every time I want to use it I've to: export PATH=/Users/$USERNAME/Library/...
2
votes
1answer
180 views

AppStore API for search and download?

I am looking for an AppStore API, official or 3rd party, that would enable me to both search for (using keywords) and download apps. I'd be downloading free apps, such as: https://itunes.apple.com/...
0
votes
1answer
71 views

play-with-mpv python server problem

I'm used to use Play with MPV Chrome extension on Arch linux which works also on MacOS. The problem is it isn't working as service for me on MacOS. If I start directly play-with-mpv in terminal, the ...
2
votes
1answer
282 views

Automator: `command not found` (Python script for command line) [duplicate]

I am trying to create an Automator application, which allows me to convert Python script files .py files to Jupyter Notebook files .ipynb using Python script for command line jupytext. However, the ...
1
vote
2answers
669 views

Can AppleScript execute a Python script?

As a math grad student I often have undergrads emailing me homework to be graded. Some undergrads do send me homework in PDF format. On the other hand many don't and it is very tiresome to convert ...