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
4
votes
0answers
691 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. ...
5
votes
1answer
7k 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
325 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
46 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
75 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
84 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
636 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 ...
2
votes
0answers
159 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
40 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
30 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
49 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
522 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
2k 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
405 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
1k 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
399 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
5k views

How to use (home) 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
43 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
1k 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
1k 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 ...
1
vote
0answers
1k 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....
2
votes
0answers
17 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 ...
2
votes
1answer
872 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
112 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
556 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
2k 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 ...
3
votes
1answer
381 views

Two red lines/bars in iTerm2 window and error message about session ending, what is going on here?

I've been experimenting with threading and running bits of python from iTerm in MacOS yesterday. Today I opened iTerm and two windows opened, one with thick red lines inside it. I received a Warning ...
0
votes
1answer
83 views

I disabled SIP and removed System Python. Now Xcode won't let me export apps

I was pissed about having 20 different versions of Python on my Mac, so in an effort to clean it up I deleted every single instance of it. I disabled SIP and cleared out the system default one. I ...
1
vote
1answer
84 views

Running script from BBEdit/TextWrangler gives “tput: No value for $TERM and no -T specified”

If I write a script in BBEdit/TextWrangler, e.g. #!/usr/bin/env python print 1234 and choose "Run" from the #! menu, I get this in a new document: 1234 tput: No value for $TERM and no -T specified ...
1
vote
0answers
353 views

GLU Library not found

I am trying to install PyFTGL to display fonts in my PyOpenGL project. When trying to install with the python setup.py install command from the downloaded PyFTGL source code folder, I get the ...
3
votes
1answer
176 views

MacOS application does not launch when double clicked but does launch from terminal

I have written a (GUI) Python script which requires one external file and one module (in a folder). In order to package this script for distribution to others, I am using the following application ...
1
vote
0answers
42 views

How to “switch my Python” to pip update the package copy that my IDLE accesses?

I have an Anaconda installation of Python as well as an installation that comes when downloading Python and IDLE from Python.org and I use both of them. For my Anaconda python I can use pip install --...
2
votes
0answers
117 views

Is it possible to use Python while in Recovery Mode?

Is it possible to access a Python terminal while in Recovery Mode? $ /Volumes/macOS/usr/bin/python python: posix_spawn: /System/Library/Frameworks/Python.framework/Versions/2.7/Resources/Python....
0
votes
1answer
130 views

Can I use IDLE to write python programs instead of the terminal on Mac?

The Mac terminal uses Python 2, and I don't know how to change the Python version.
1
vote
1answer
137 views

How can I change my Python 2.7 to 3.5? (I've already changed my bash_profile) [duplicate]

I downloaded Python 3.7, and then I deleted and changed Python 3.7 to 2.7 (using bash_profile, I changed the content in bash profile, just like the image below), and it worked. But I found that ...
1
vote
1answer
2k views

MacOS Mojave - can't use Camera with imutils in Python

After the new update to macOS (Mojave), I can't access the camera. I'm using a python script with opencv and imutils (doing some object detection), and once I run the script, it stops. After the debug ...
4
votes
2answers
3k views

Homebrew Vim with Python support depends on Python 3.7.0, and I have to use 3.6.5

I have to use Python 3.6.5 because of a library I use that keeps showing bugs on 3.7.0 (TensorFlow). I installed Python 3.6.5 using Homebrew as follows: brew install https://raw.githubusercontent....
1
vote
1answer
589 views

How to manually input data into a python script while running in Atom or VScode?

I have an iMac running High Sierra. I've been learning python and I use Atom or VScode. One problem I've experienced in both of these is that if I run a python script with an input statement like: ...
2
votes
1answer
440 views

“brew install python3” fails to compile pyexpat

brew install python3 fails with a pyexpat error, which means the installed Python can't parse XML (breaking pip etc). Here's the relevant excerpt from ~/Library/Logs/Homebrew/python/02.make: *** ...
1
vote
1answer
2k views

Install SublimeHighlight plugin on Sublime Text 3

I'm trying to copy my code from Sublime Text 3 into my Word document in RTF format with colors in tact by using this plugin: https://github.com/n1k0/SublimeHighlight The instructions say: Sublime ...
3
votes
1answer
3k views

How to access files on a networked smb server with Python on macOS

I have a bunch of files that sit on a networked drive to which I can connect by using Finder > Go > Connect to Server and entering the address smb://smb-name.institute.name.org/DRIVENAME and then ...
1
vote
0answers
203 views

installing NEURON package for python on mac

I have some problems with installing NEURON package. first, the problem is that I can't import neuron in PyCharm and I get an error that "No module named 'neuron'". also in terminal after installing ...
2
votes
0answers
227 views

How do I employ AppleScript in Python?

I made a program to generate contracts in bulk based on data from an .xlsx file. I originally made it for PCs, and now I'm trying to create a mac version. Everything seems to be running smoothly, but ...
1
vote
1answer
145 views

Is it possible to stop the execution of a script temporarily on macOS? [closed]

I have a Python script that learns a Deep Learning model. It takes so much time to execute (usually more than 6 hours). Now, the problem is it is MacBook Pro and I frequently go out with it, and ...
1
vote
1answer
33 views

Find all folders with rwx permissions for a certain user?

How do I find all the folders that have rwx permissions for a certain user? Preferably no admin, can use shell scripts, Terminal, Python 3.6.
3
votes
0answers
2k views

Python quit unexpectedly when running Python programs from terminal

I am using Terminal to run code on my macOS High Sierra. I use Python all the time on my laptop (all day every day) and this is the first time I have seen this and it's come somewhat suddenly. I haven'...
1
vote
1answer
377 views

Installing pyqt5 with homebrew just for python2

I don't have (and do not wish to have) python3 installed. I want to install pyqt5 just for python2. However every time I try to install pyqt5 with homebrew it keeps downloading python3 and trying to ...
0
votes
1answer
61 views

Pip wont update

Hi I am trying to update pip and receiving this error: egts-iMac-3:~ egt$ pip install -U pip You are using pip version 6.1.1, however version 10.0.1 is available. You should consider upgrading via ...
1
vote
1answer
2k views

How can I override default Python modules with ones I install with pip?

I've run into this issue with PIL and Pillow. I didn't realize PIL was already installed, so I ran: sudo pip install PIL As best I knew, it installed PIL. Then I wrote a program that used a ...
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 2
3
4 5
10