A quick solution is to use homebrew to install python into /usr/local/bin so that your pip can run against a user-modifiable python framework.
brew install python
Disabling System Integrity Protection is also an option, but I don't recommend that for anything but professionally managed and fire walled servers where you have the manpower to ...
Another viable option without a need to disable SIP or install other Python versions, is to install the modules only for the current user using
pip install --user <modulename>
If it is just your personal machine, this would be the simplest and safest solution.
For Python in macOS, use pyenv:
brew install pyenv
To install a specific Python version, run:
pyenv install <version>
To select a version:
pyenv local 3.5.0
Note that you must update PATH to override the default Python version:
To list available versions:
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/homebrew-core/f2a764ef944b1080be64bd88dca9a1d80130c558/Formula/python.rb
If you are getting:
# --ignore-depeError: python contains a recursive dependency on itself:
This problem often arises when pip tries to install a manpage for IPython on El Capitan. The quick fix is to use a pip command like this:
sudo -H pip install --install-option '--install-data=/usr/local' <package>
However, System Integrity Protection (SIP) on El Capitan blocks several bad practices with pip that used to slide by, so you will probably ...
I personally use Homebrew, which is a very nice package manager.
If you want to give this a try, first of all make sure you have the XCode Command Line Tools installed on your Mac.
Then install Homebrew by typing
ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
in the Terminal.
Homebrew will place its "Cellar" (the ...
$ 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 before install.
Check the git history of python.rb
Find the version you want. Now you can use brew install with the corresponding commit hash:
3.4.3_2: brew ...
Preferences are cached in 10.9. See http://hints.macworld.com/article.php?story=20130908042828630. If you edit a plist file directly or replace the plist of an application, the application will keep using the cached version even after you quit and reopen the application.
You can run defaults read com.googlecode.iterm2 or killall cfprefsd to apply the ...
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.framework directory from /Library/Frameworks.
which python3 ---> /usr/local/bin/python3 Delete the entire python3 directory.
I was a bit nervous about the symlinks. ...
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:
You can do this without even having to edit this file if you like, using the following one-liner:
$ echo 'export ENV_VAR=12345' >> ~/.bash_profile
And then confirm like so:...
First, you're not disabling SIP as a way to address the issue. Sorry that's the reason that this folder creation is failing, but we have to work around it. Second, you lose all the niceties Apple thought they were giving you, like a bridge via pyObjC, when you install your own Python.
(I'll admit, they say you should install your own to /usr/local if you're ...
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 processes will continue to run.
PS: Processes which were waiting for network or disk data when going to sleep may run into timeouts though. But that can happen ...
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 developer tools are installed, the /usr/bin/python3 stub will run the actual python3 binary, but a clean install will just have the stub.
The Python 2 binaries (/usr/...
Use Homebrew :)
brew install python3
Hombrew installs everything into /usr/local/Cellar and creates symbolic links for applications in /usr/local/bin. It will not touch anything else in the system. It comes with the brew cleanup command, which removes unused or outdated applications automatically.
To update it:
brew upgrade python3
It will ...
/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 system use. So the only way to get them back is to reinstall the OS. To do that, boot into recovery mode by holding cmd+r during startup, then after it boots up, ...
Having great trouble migrating iTerm2 (2.0.0) plist to my new Mac running Yosemite (10.10.1). What I did to fix that is:
Open iTerm2, so a default com.googlecode.iterm2.plist file is created.
Deleted all cached preferences for iterm2 by issuing defaults delete com.googlecode.iterm2
Copied the file to the new Mac in the correct location inside ...
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 --ignore-dependencies python3
brew install python3
Python 3.7.2 (default, Jan 13 2019, 12:51:54)
[Clang 9.0.0 (clang-900.0.39.2)] ...
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 Python 3.6.5 use:
brew unlink python # If you have installed (with brew) another version of python
brew install --ignore-dependencies https://raw....
Figured it out.
brew install libffi
(in this case i also had to run the command to build the locate database, for which the code was included in the prompt from locate)
Then within the virtualenv ran export PKG_CONFIG_PATH=/usr/local/Cellar/libffi/3.0.13/lib/pkgconfig/ (...
I have done this sort of thing in two ways - however both do not coexist with homebrew although I suspect there should be a way similar to the macports one.
General package manager
The first is using Macports as the package manager. There are separate ports for several python versions 2.x and 3.x currently 2.4, 2.5, 2.6, 2.7 and 3.1, 3.2, 3.3 3.4 and 3.5. ...
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, programs on your computer continue to run normally. When your Mac enters computer sleep, programs are paused, and will resume when the computer is awakened (but some ...
There appears to be an issue with recent Macports builds of python see this bug
A workaround is to install pyXX-readline (py35-readline has been produced just for this bug)
Another is to install python addding the +readline variant
Yes - that file is part of the system image and ships on every Mac.
When fully installed, version 3.7.3 is what Catalina installs from this stub. Keep in mind python 2.7.16 is still the default python if you don’t call python3
~ % /usr/bin/python3 --version
~ % /usr/bin/python --version
~ % sw_vers
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 terminal tool caffeinate. Once called it will prevent the machine from sleeping until you cancel the program using ctrl+c.
You can pass arguments like the process ...
First, execute in a terminal with zsh (Z Shell):
echo 'export ENV_VAR=12345' >> ~/.zshenv
Then, reload changes:
Finally, test if your new variable is set:
By standard, the .zshenv file should only contain environment variables setting commands. .zshenv is sourced on all invocations of the shell, hence it will ...