As of May 31, 2023, we have updated our Code of Conduct.

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
93 votes
5 answers
228k 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?
Paul's user avatar
  • 755
116 votes
12 answers
170k views

How to use pip after the OS X El Capitan upgrade?

After the El Capitan update, I am unable to run pip install. The error I get is that the "operation is not permitted" when pip tries to create new folders while installing. creating /System/Library/...
web_ninja's user avatar
  • 1,263
11 votes
3 answers
19k views

WARNING: The version of Tcl/Tk (8.5.9) in use may be unstable

I'm running macOS Sierra 10.12.2 and am trying to get Python's IDLE to work properly with Tcl/Tk. This is the error message I'm getting when I open IDLE: Python 2.7.13 (default, Dec 18 2016, 07:03:39)...
Borealis's user avatar
  • 191
28 votes
2 answers
28k views

iTerm2 doesn't read com.googlecode.iterm2.plist

I am iTerm2 (1.0.0) user. I know how to create profiles, by using iTerm settings or modifying com.googlecode.iterm2.plist file. For convenience, I will use .plist to indicate com.googlecode.iterm2....
Gyuhang Shim's user avatar
27 votes
7 answers
97k views

M1 mac: mach-o file, but is an incompatible architecture (have 'x86_64', need 'arm64e') - python

When I try to run "scrapy startproject" in vscode, below error comes up. Traceback (most recent call last): File "/Users/admin/Desktop/development/project/scrapyTutorial/venv/bin/...
Ryan's user avatar
  • 373
11 votes
2 answers
26k 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 ...
ruohola's user avatar
  • 999
10 votes
3 answers
43k views

How to create a VPN connection via terminal?

I have a macbook pro with mavericks running. I am looking for a way to connect to a VPN network in terminal. The reason why I want to do this is that I want to write a small program in Python which ...
Choushishi's user avatar
6 votes
2 answers
6k views

homebrew - trouble upgrading openssl?

I'm on osx 10.11. (Background: I'm having trouble getting the system installed Python to use TLS 1.1.) From what I've read I need to use brew to manage Python. But I want to upgrade openssl first ...
Greg's user avatar
  • 223
5 votes
1 answer
10k views

Deleted /usr/local/bin and /usr/bin on OS X

Guys yesterday i asked my brother to delete python 2.7 and install python 3.5 but rather than delete parts of python, he deleted all /usr/local/bin and /usr/bin. At this point /usr/bin is empty and /...
John's user avatar
  • 55
4 votes
4 answers
16k views

Mount Windows smb shares on a Mac using Python

I would like create a python script that mounts a Windows smb share on a Mac then copies data to it. I am falling at the first hurdle, having problems with mounting the share. It should be really easy ...
John Harris's user avatar
3 votes
1 answer
7k 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/...
Ryan Zhou's user avatar
3 votes
3 answers
1k views

Using python 3 when the default is python 2.7

I installed python3 with homebrew and can access it with python3 command in terminal. I'm installing a command line app that needs python3. When I try to use it it says: Python 3.3+ required When ...
Harry's user avatar
  • 2,150
79 votes
9 answers
170k 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 ...
clay's user avatar
  • 1,087
54 votes
3 answers
85k 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 ...
Nicholas Hassan's user avatar
22 votes
2 answers
13k views

How to compile mod_wsgi, mod_fastcgi, etc on Mountain Lion (Mavericks) by fixing `apxs:Error: Command failed with rc=65536`?

I've updated to OS X Mountain Lion. Update has removed all of my python and apache modules including mod_wsgi. Now I'm trying to recompile mod_wsgi (it compiled without problems on Lion). I use ...
Daniil Ryzhkov's user avatar
16 votes
6 answers
105k views

My Mac has Python3 and 2.7 installed. How do I uninstall Python3 but keep 2.7? [closed]

I installed python3 a few days ago, but I need to use version 2.7 for school. When I run in terminal, it shows like below: RandeMacBook-Pro:~ ranshu$ which python /Library/Frameworks/Python.framework/...
R.Samuel's user avatar
  • 161
8 votes
1 answer
8k views

How do I change back from MacPorts Python to system default version?

I used MacPorts to install a newer version of Python on my system (10.5.8 PPC), and then used the MacPorts select command to change the default invoked version of Python to the MP version. Now I want ...
CyberSkull's user avatar
  • 2,517
7 votes
3 answers
7k views

How best to isolate my development environment on OS X?

What is the current best practice for setting up a development environment on OS X? I recently got a new Mac with OS X 10.10, Yosemite. I'm familiar with homebrew, and from my Linux experience, ...
tommytwoeyes's user avatar
6 votes
1 answer
19k 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 ...
Qiulang 邱朗's user avatar
5 votes
1 answer
9k 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 ...
Thomas Kessler's user avatar
5 votes
3 answers
8k views

How to make an executable .py available everywhere on OS X?

I have this directory /foo/bar/. Inside, I have a python file named myfile.py. I made it executable by adding (at the top): #!/usr/bin/env python Then, I made it executable by issuing chmod +x ...
ilovebigmacs's user avatar
5 votes
2 answers
22k views

How do I know which Python install is being used?

If I type the command which python, then I get: Oliviers-iMac:~$ which -a python /System/Library/Frameworks/Python.framework/Versions/2.7/bin/python /usr/bin/python If I then type python --version, ...
Olivier's user avatar
  • 283
4 votes
3 answers
2k views

Make a python program an application

I would like to make a Python program executable, like in Windows, when you use a program like cx_Freeze to make Python programs become .exe. I would like to do the same for Mac, I would like to make ...
user avatar
4 votes
2 answers
2k 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 ...
cwasdwa's user avatar
  • 41
4 votes
2 answers
3k views

pygame installed through homebrew does not work?

I ran brew install pygame, it installed it together with all the dependencies. Python v2.7.10 / OS X version 10.11.2 Whenever I import pygame in a script it says this Traceback (most recent call ...
DisplayName's user avatar
  • 1,972
3 votes
1 answer
8k views

How to update Python on a Mac with Unix commands

After giving up on doing a disk partition and getting Linux, I decided to try and install Python 3.3.2 on a 32 bit Intel Core 2 Duo iMac with OS X 10.6.8 Snow Leopard. I did pretty much everything the ...
reggaelizard's user avatar
2 votes
1 answer
6k views

Mac OS 12.3+ /usr/bin/python requirement

As of macOS 12.3, Apple no longer ships Python 2 However, I am trying to install a program (.pkg installer) that depends on /usr/bin/python and it fails. In /var/log/install.log I see this error: /usr/...
kym's user avatar
  • 161
2 votes
3 answers
2k views

Automator action to run python script on series of files fails in Catalina

Major edit I've just discovered that the Automator workflow I'm having problems with works perfectly if I run it by pressing 'play' in the Automator window, and it seemingly only fails when I save it ...
John Coxon's user avatar
2 votes
0 answers
1k views

how to pack python package that includes python scripts and bash scripts for OSx as pythonTool.app?

I have made a python tool which I want to share with users. I tried Automator, and it works but in that I used Application > Run Shell Script in which I hard coded the path to my python script, but ...
Ciasto piekarz's user avatar
2 votes
2 answers
1k views

Python script executable opened by text editor

I have a simple "Hello world" script that I want to turn into an executable. The problem is that even though I went through the steps of declaring the path of the Python interpreter in the first list ...
BubbleTree's user avatar
2 votes
1 answer
3k views

ipython/python broken after upgrading to OS X Mavericks

After upgrading to OS X Mavericks, it seems Python broke. I get the following when I try to run ipython: ~ $ ipython Traceback (most recent call last): File "/Library/Frameworks/Python.framework/...
houbysoft's user avatar
  • 9,032
2 votes
1 answer
5k views

File launches in Launchctl with PID - Status 1

I have a Python program that writes to the /etc/hosts file. It works correctly manually entered using the sudo command. I want it to open automatically. I can load it into sudo launchctl but it ...
epictrojan's user avatar
1 vote
1 answer
3k views

Python IDLE from MacPorts can't start

I tried installing the python27 and python32 packages via MacPorts in Mac OS X 10.6.8. It includes the standard IDLE, Python Launcher, and Build Applet applications. However, when I start them, their ...
hpy's user avatar
  • 5,405
1 vote
1 answer
126 views

PIP3 compile not working on Catalina

On my Mac (OSX 10.15.7) I try to install something using pip3: pip3 install ovirt-engine-sdk-python I get a GCC error: gcc -Wno-unused-result -Wsign-compare -Wunreachable-code -fno-common -dynamic -...
Krist van Besien's user avatar
1 vote
1 answer
1k views

how to capture folder as input and pass it to python script as argument

How to capture folder as input and pass it to python script as argument? This is what I have so far, but this is always taking the user home directory as input no matter which folder i right click > ...
Ciasto piekarz's user avatar
1 vote
2 answers
477 views

How can I install NumPy / SciPy on Lion?

Macports? Binary? RVM-esque tool? Other? I will be using NumPy/SciPy for a computer vision project, so I want to do it once and do it right.
Francis Haart's user avatar
1 vote
1 answer
462 views

How to use macports Python in a cron job?

I have installed Python 2.7 through mac ports, and now want to have it used in a cron job. Unfortunatly, each time the cron job gets involved, the standard Python of my machine (an iBook G4 using ...
Riduidel's user avatar
  • 197
1 vote
1 answer
2k views

Homebrew says my Python installation could cause issues and I'm not sure what to do

I'm just getting started with web development and I'm trying to set up my environment, and I can't do that until Dr Homebrew has discharged me from N00bcake Hospital. This is what I'm getting: ...
reggaelizard's user avatar
0 votes
1 answer
102 views

My Mac doesn't allow installation of any software

Every time I try to install any software on my Mac, it comes up with an error. I have scoured the net and have followed advice which includes checking if there's enough space (which I have), checking ...
Vieldside's user avatar
0 votes
2 answers
642 views

Python 3 'json' module is actually corrupted

I'm asking this question here and not on Stack Overflow because it appears to be MacOS specific. Many answers over there point to searching for a bad "json.py" module however we can see from ...
Charney Kaye's user avatar