The default python will cause some problems, so add pyenv to get the right version.
1-1. Add brew 1-2. Insert pyenv-rehash 1-3. Editing .bash_profile or .zshrc
see : http://brew.sh/
If you install a package called pyenv-rehash, pyenv will be installed as well.
$ brew install pyenv-rehash
Added the following. Tell the location of pyenv.
export PYENV_ROOT=/usr/local/opt/pyenv
if [ -d "${PYENV_ROOT}" ]; then
export PATH=${PYENV_ROOT}/bin:$PATH
eval "$(pyenv init -)"
fi
I use anaconda, which installs packages for scientific calculations at the same time.
2-1. Install anaconda 2-2. Make sure that python installed in anaconda is used
$ pyenv install anaconda-2.1.0
$ pyenv global anaconda-2.1.0 #Specify the python included in anaconda as the system default python
$ pyenv local anaconda-2.1.0 #Make sure that the python contained in anaconda is specified only in that folder
$ pyenv rehash
After doing this, type the following and if `` `/ usr / local / opt / pyenv / shims / python``` is specified, you're done. If not, try restarting the terminal.
$ which python
Finally, install theano you are looking for. Please note that there is one point and a fitting point.
3-1. Install theano 3-2. Downgrade pyparsing
Originally, you have to set it while including numpy and scipy, but By adding anaconda, it's doing a good job, so if you suddenly add theano, it's okay.
$ pip install theano
I get an error when trying to import theano from python.
>>> import theano
Couldn't import dot_parser, loading of dot files will not be possible.
The pyparsing that is included in anaconda as of 2015-08-17 from the beginning is v2.0.1, which is the cause. It seems that v1.5.7 should be used, so install v1.5.7
$ pip install pyparsing==1.5.7
Now you can use theano without any problems.
Reference: [pydot and graphviz error: Couldn't import dot_parser, loading of dot files will not be possible](http://stackoverflow.com/questions/15951748/pydot-and-graphviz-error-couldnt-import-dot -parser-loading-of-dot-files-will? rq = 1)
Recommended Posts