Stack Exchange Network

Stack Exchange network consists of 174 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

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.

0
votes
0answers
7 views

How to batch import images (one per slide) into a PowerPoint 2016 Mac document

I am looking to import 400 separate eps files into a PowerPoint 2016 template, one per page. I have to do this monthly. Some notes: They must be EPS files, as they contain text, and the EPS files ...
-2
votes
0answers
13 views

Pycharm Site-packages truned red [closed]

So as I was trying to install pip which I later figured out that I have it available since I first installed python. So I am not sure what I did when I was trying to manually install pip. I used a ...
1
vote
0answers
18 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 ...
0
votes
0answers
103 views

Install vtk with python 3

I am under Mojave. I would like to install vtk with brew such that I could use the python bindings in python 3. brew info vtkreturns: vtk: stable 8.1.1 (bottled), HEAD Toolkit for 3D computer ...
2
votes
1answer
20 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
13 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 --...
1
vote
0answers
22 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
42 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
24 views

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

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
100 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 ...
1
vote
1answer
111 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
32 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
106 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
26 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 ...
1
vote
1answer
136 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
30 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
40 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
23 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
0answers
49 views

Brew doesn't recognize previously installed python

I want to use python2 with brew by default. That means that when I type python, it will go to python 2.7.11 . Currently, brew insists on not linking python that it itself installed. Also, when ...
1
vote
1answer
32 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.
0
votes
0answers
74 views

Why does my pip3 installed with Homebrew try to write packages to the system library?

I have apparently done something horrific to my Python install. I just recently installed Python 3.7.0 using Homebrew. When I attempt to use pip3 to install a package, it fails: $ /usr/local/Cellar/...
1
vote
0answers
257 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'...
0
votes
0answers
136 views

how to install skimage on mac?

when I try to install skimage its get error like: (with) $sudo pip install skimage Complete output from command python setup.py egg_info: * Please install the scikit-image package (instead of ...
0
votes
0answers
20 views

Problem updating conda

I use the Anaconda distribution of python. Recently when I use conda I get a message that my version of conda is out of date and I should update to the newest version. It suggests I use conda update -...
0
votes
1answer
37 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 ...
0
votes
1answer
38 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 ...
41
votes
5answers
36k 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 ...
0
votes
1answer
278 views

How to make Visual Studio Code run python 2.7.15

I'm using an iMac with High Sierra. I used Anaconda to install both python 2.7.15 and python 3.6.5. I created virtual environments for both of these. I'm trying to learn python and I'm using Visual ...
0
votes
1answer
31 views

PyCharm packages issue

I'm using PyCharm as Python IDE, on macOS High Sierra and my default Python version is 3.6.5, I have a big issue within packages using PyCharm. As an example of my issue, I have installed Pillow ...
1
vote
1answer
1k views

Fix virtualenv after installing python 3 with brew

Previously I had the default Python 2.7, and I have a lot of virtualenvs created under python 2, using virtualenvwrapper. Recently, I wanted to be able to use python 3 as well as python 2. brew ...
0
votes
0answers
15 views

Two Text Clipping files showed up on desktop named “python” and 'the name of a client'

preliminary notes: It appears this could simply have something to do with copying text from Upwork and editing in TextEdit, but I don't know why (they exist, on the desktop, and why they are named ...
1
vote
1answer
109 views

Why does High Sierra complain about IDLE?

I've installed an updated version of python 2.7, which comes with the IDLE development environment. High Sierra is giving me warnings that it needs to be updated (which I took to mean that it's 32-...
1
vote
1answer
796 views

Installing virtualenvwrapper on macOS Sierra - “-bash: /usr/local/bin/virtualenvwrapper.sh: No such file or directory” error

I'm a bit of a newbie to Python and definitely to virtual environments and Django. I want to install Django but it first recommends a virtualenv / virtualenvwrapper. A video I am watching recommends ...
3
votes
0answers
157 views

Python process suspended despite running caffeinate

I have a long running Python process (using multiprocessing), run from Terminal, and regularly come back to it realizing that it has been suspended for several hours while I was away from the Mac. The ...
2
votes
0answers
56 views

Applescript that efficiently listens for changes to the clipboard?

I'd like to do something whenever clipboard content changes. I have a solution working now where I get the clipboard value and store it, then I start an infinite loop where I look up the clipboard ...
0
votes
2answers
112 views

Python program does not display correctly on 10.13, but works on old MacBook

I asked this question https://stackoverflow.com/questions/49955313/toplevel-does-not-create-new-independent-windows-on-macos on Stack Overflow, thinking it was a Python programming problem. Since ...
4
votes
1answer
2k views

Unable to upgrade to python 3.6 from python 2.7

I'm trying to remove python 2.7 and replace it with python 3.6. The main thing I want to do is type "python" and my terminal use python 3.6, but for some reason I'm being restricted from upgrading ...
4
votes
0answers
22 views

Is there an api to the Mac-OS where I can disable screen dim from an application (like python) and when I am ready I can enable it again? [closed]

I have an application to run a slideshow on the mac. I would like to disable screen dimming when I start the slideshow, and enable it again when I stop the slideshow... Therefore I need an api into ...
1
vote
1answer
30 views

Debug iPhone Mobile Safari without Web Inspector

I'm using Pythonista, a mobile Python environment to code on my iPhone while I'm on the train with no laptop around. I've started working on a small web application using bottle and d3.js. However, ...
1
vote
0answers
28 views

Find out default screenshot path in MacOS from within Python to monitor screenshots

I have a program that monitors for new screenshots but however, I had to change the default screenshot directory to /screenshots instead of the in com.apple.screencapture How can I obtain the ...
1
vote
1answer
191 views

Launch agent invoking python script returns permission error

I'm trying to use the following .plist to invoke a python script. <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs ...
1
vote
1answer
31 views

Some iTunes URL generate 404 response from python but still work when you browse them from a web browser

I am using python requests to get itunes URL responses. for some links it works and for others it doesn't, for example: working - https://itunes.apple.com/SA/app/id944846798?ls=1&mt=8 not ...
0
votes
1answer
255 views

How to install a virtual environment of Python in macOS

First steps with Python, I am trying to run Python in a virtual environment in macOS. I Googled "install virtual environment python mac" and got a link for this. When I typed in Terminal: $ pip ...
0
votes
1answer
183 views

After deleting my system python, how can I restore it? [duplicate]

I stupidly deleted the system python on High Sierra, hoping to only use the Homebrew version. However, now I want it back. How can I restore it?
1
vote
0answers
50 views

Distributing a python application on macos with a required executable

I am developping and distributing a python program for linux, windows and macos. I use pyinstaller with the onefile option to package the application so it is easy to use by non technical users (no ...
1
vote
1answer
190 views

Deleting a line from Bash profile

So using terminal I typed in: nano .bash_profile I then have access to the following bash_profile : GNU nano 2.0.6 File: .bash_profile ...
0
votes
0answers
52 views

Python 3 from Python.org: pros and cons

I am trying to use QGis but sadly it needs not simply Python 3, but the python.org install -- nothing else will do. QGis in not available in the latest version either via homebrew nor anaconda, which ...
0
votes
0answers
1k views

macOS High Sierra python3 / pip awscli install path confusion

Was playing around with brew install asciinema and it broke my python install on macOS High Sierra (10.13.3 (17D47)). But now that I'm re-installing python for the awscli via pip, it's not acting ...
2
votes
1answer
133 views

Force terminal to use binary from a different path

I have installed pandoc using homebrew and the Anaconda python distribution using pyenv. I've just found that Anaconda comes with its own pandoc binary and since the pyenv shims come before homebrew ...
0
votes
1answer
2k views

Changed my PATH to have /usr/local/bin ahead of /usr/bin and now pip isn't found

I was following this guide to get Python 3 setup, which recommended changing the PATH variable such that "# If you still see 2.7 ensure in PATH /usr/local/bin/ takes pecedence over /usr/bin/". I put ...