Let's write the setting order of python so that the true beginner can understand. However, it is assumed that you have enough knowledge about the terminal (something black screen). It is for setting tensorflow for deep learning, but aim for a level where the library can be set. Or rather, I bought a macbook Pro and wrote my own notes that I was rebuilding.
homebrew
The one that is convenient for installation and settings.
from here. Http://brew.sh/index_ja.html
ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
But it looks good.
When using python, it seems that it is better to distinguish between the part used as a system and the part that you move by yourself, so I will put in a tool for managing python. Don't get in the way of people who work hard. No detailed explanation will be given.
$ brew install pyenv-virtualenv
It seems that you can enter all at once.
I will describe it in detail because it is a part that amateurs do not understand well. Even if you install python, if you do not specify where the installed program is, you will not know where you went and you will have trouble running it.
.bash_profile
, but since it may not be a new MAC, I will make it. Check with cd
or ls
and create with $ touch .bash_profile
. The location is directly under the user's folder.
(Reference) http://motomichi-works.hatenablog.com/entry/2016/03/02/103207
As a caveat, it is necessary to display it because it is not normally seen from the Finder. [Inforati, a hidden technique to show hidden files and folders with Mac keyboard shortcuts](http://inforati.jp/apple/mac-tips-techniques/system-hints/how-to-show-hidden-file- in-open-save-dialog-in-mac-os-easily.html).bash_profile
export PYENV_ROOT=$HOME/.pyenv
export PATH=$PYENV_ROOT/bin:$PATH
val "$(pyenv init -)"
.bash_profile
if which pyenv > /dev/null; then eval "$(pyenv init -)"; fi
export PYENV_ROOT=/usr/local/var/pyenv
if which pyenv-virtualenv-init > /dev/null; then eval "$(pyenv virtualenv-init -)"; fi
$ pyenv install (The version you want to include)
Use pip.
Recommended Posts