Skip to main content
115 votes
Accepted

How to add permanent environment variable in zsh

Bash Since Bash is typically the default shell you can open up this file in your home directory: $ vim ~/.bash_profile And add your variable to this file: export ENV_VAR=12345 You can do this ...
slm's user avatar
  • 4,878
110 votes

How to install specific version of python on OS X

For Python in macOS, use pyenv: brew install pyenv To install a specific Python version, run: pyenv install <version> To select a version for every command run with the current folder: pyenv ...
Knight71's user avatar
  • 1,211
92 votes
Accepted

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

If you still have the previous versions available, you can just use brew switch python 3.6.5_1
knilsilooc's user avatar
  • 1,044
62 votes
Accepted

Remove and Reinstall Python on Mac -- Can I trust these old references?

So, I ended up removing all python installations, and reinstalling things via Homebrew. which python ---> /Library/Frameworks/Python.framework/Versions/2.7/bin/python Delete the entire Python....
zipzit's user avatar
  • 1,803
62 votes

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

If you don't have previous version to switch to, you can install Python 3.6.5_1 from previous formula this way: $ brew unlink python $ brew install https://raw.githubusercontent.com/Homebrew/...
rinat.io's user avatar
  • 721
57 votes

How to install specific version of python on OS X

$ brew install python3 is equals follow $ brew install https://github.com/Homebrew/homebrew-core/blob/master/Formula/python.rb So. if you want to install a specific version then, you must check ...
Jay's user avatar
  • 571
46 votes
Accepted

Do Terminal processes stop if Mac sleeps?

All processes get paused when the system goes to sleep, independent of whether the process is part of macOS, an application or some code you wrote on your own. After the system wakes up again, all ...
nohillside's user avatar
  • 103k
45 votes

How to add permanent environment variable in zsh

First, execute in a terminal with zsh (Z Shell): echo 'export ENV_VAR=12345' >> ~/.zshenv Then, reload changes: source ~/.zshenv Finally, test if your new variable is set: echo $ENV_VAR ...
Guillermo Garcia's user avatar
43 votes

Do Terminal processes stop if Mac sleeps?

Yes, terminal processes like a python script will stop execution when the machine goes into idle sleep. To prevent your machine from sleeping without changing the settings you can just use the ...
cgx's user avatar
  • 531
37 votes
Accepted

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

Kinda. A clean installation of Catalina includes a /usr/bin/python3 binary, but it's a stub for installing the command line developer tools, which includes Python 3. If/when the command line ...
Alexander O'Mara's user avatar
37 votes
Accepted

How to make python 3.11 my default python3 with brew

Note: This applies to any versioned Python installation with Homebrew After installing Python 3.11, you are given the location of the bin folder with Python 3.11: ==> Caveats Python has been ...
Ezekiel's user avatar
  • 10k
31 votes

How to install specific version of python on OS X

Install the required version: % brew install [email protected] % brew list | grep python % brew ls [email protected] % ls -l /usr/local/Cellar/[email protected]/3.7.8_1/bin/python3.7 Add a soft link to /usr/local/bin/...
Albert's user avatar
  • 419
31 votes

Remove and Reinstall Python on Mac -- Can I trust these old references?

My Python version was 3.6, I wanted to upgrade to 3.7 (In case you have similar requirements). I am using macOS version 10.12.6 and simply uninstalling and re-installing worked for me: brew uninstall ...
Tadpole's user avatar
  • 311
23 votes

Will macOS Big Sur remove the default Python installation for good?

No, on Apple Macs being shipped with Big Sur, Python 2 and Python 3 are both still included. $ which python /usr/bin/python $ python --version Python 2.7.16 $ which python3 /usr/bin/python3 $ ...
Allen Ellis's user avatar
18 votes
Accepted

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

/usr/bin is where most of the Terminal commands are stored (e.g. clear). When your brother deletes everything in /usr/bin, he basically deletes most of the executable files that the Terminal and the ...
Tom Shen's user avatar
  • 3,327
18 votes

Do Terminal processes stop if Mac sleeps?

Note that there is a difference between computer sleep and display sleep (both controlled in the Energy Saver pane of System Preferences). When the display is sleeping but the computer is not, ...
Ben Turner's user avatar
16 votes

Prevent "<application> quit unexpectedly" message on sigquit

You can also make the message appear as a notification instead: defaults write com.apple.CrashReporter UseUNC 1
Tim Baverstock's user avatar
16 votes

Where is my .bash_profile located? (Mac OS 10.10.5)

Navigate to your user folder in Finder: /Users/username/ Make hidden files visible (the shortcut is ShiftCmd.) Right click .bash_profile and Open With... your text editor of choice. ShiftCmd. one ...
Mentalist's user avatar
  • 1,172
15 votes
Accepted

Restore Python 2.7 on Monterey 12.3?

The Python Release Python 2.7.18 | Python.org download page has a macOS 64-bit installer download that replaces the missing interpreter.
scruss's user avatar
  • 618
15 votes

How to make python 3.11 my default python3 with brew

On macOS Ventura & Sonoma on Apple Silicon To install homebrew's version of python3: brew install python3 This installs brew's version of python3.x but does not override the the link to macOS's ...
Doomd's user avatar
  • 313
15 votes

How to confirm MacOS "system" Python version

Homebrew installations are independent of macOS, you can neither update system components via Homebrew nor remove them with brew uninstall.
nohillside's user avatar
  • 103k
14 votes

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

Two options To recover a previously installed Python version: brew switch python 3.x.x_x # Ex. 3.6.5_1 Use brew info python to see what you have previously installed To make a clean install of ...
ePi272314's user avatar
  • 997
13 votes

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

Yes - that file is part of the system image and ships on every Mac. It is a stub app that calls xcode-select --install which installs all command line developer tools, which includes python3 binary in ...
bmike's user avatar
  • 239k
13 votes

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

Try using pyenv. This library will help you switch between different versions of Python (in case you need to run Python 2.x for some reason, and in anticipation of Python 4.0 coming). Install pyenv ...
Shubham Kumar's user avatar
13 votes
Accepted

Will macOS Big Sur remove the default Python installation for good?

No, it didn't get removed in Catalina, nor in Big Sur, and not even on the initial release of Monterey, but finally in macOS Monterey 12.3 it does get removed: https://developer.apple.com/...
ruohola's user avatar
  • 1,008
13 votes

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

What it worked for me was: pip uninstall lxml ARCHFLAGS="-arch arm64" pip install lxml --compile --no-cache-dir
Sandra Meneses's user avatar
12 votes
Accepted

Where is my .bash_profile located? (Mac OS 10.10.5)

You can edit bash profile with vi ~/.bash_profile make sure the PATH was not added in ~/.bashrc or to /etc/profile To remove the PATH you can either remove it from the file where it was added, or ...
sebastienvg's user avatar
12 votes
Accepted

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

I use conda from miniforge for python packages etc. This works. This means that I don't know first hand how pypi works, I just have looked at the documentation. I think by default it looks for ...
mmmmmm's user avatar
  • 30.6k
9 votes
Accepted

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

From Xcode 11 Beta Release Notes: Scripting language runtimes such as Python, Ruby, and Perl are included in macOS for compatibility with legacy software. In future versions of macOS, scripting ...
nohillside's user avatar
  • 103k
8 votes

How to install specific version of python on OS X

This seems like a much easier approach AND keeps away from /usr/local/bin !! https://github.com/sashkab/homebrew-python I haven't tested it, but it promises to be able to install any version (and ...
BrendanSimon's user avatar

Only top scored, non community-wiki answers of a minimum length are eligible