[PYTHON] How to install Theano on Mac OS X 10.10 (using pyenv, anaconda)

Environment of the installed machine

To-do list

  1. Install pyenv
  2. Install anaconda via pyenv
  3. Install theano via pip

1. Install pyenv

The default python will cause some problems, so add pyenv to get the right version.

What is pyenv?

procedure

Procedure list

1-1. Add brew 1-2. Insert pyenv-rehash 1-3. Editing .bash_profile or .zshrc

1-1. Add brew

see : http://brew.sh/

1-2. Insert pyenv-rehash

If you install a package called pyenv-rehash, pyenv will be installed as well.

$ brew install pyenv-rehash

1-3. Editing .bash_profile or .zshrc

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

2. Install anaconda via pyenv

I use anaconda, which installs packages for scientific calculations at the same time.

What is anaconda?

procedure

Procedure list

2-1. Install anaconda 2-2. Make sure that python installed in anaconda is used

2-1. Install anaconda

$ pyenv install anaconda-2.1.0

2-2. Make sure that python installed in anaconda is used

$ 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

3. Install theano via pip

Finally, install theano you are looking for. Please note that there is one point and a fitting point.

procedure

Procedure list

3-1. Install theano 3-2. Downgrade pyparsing

3-1. Install theano

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

3-2. Downgrade pyparsing

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)

Summary

Recommended Posts

How to install Theano on Mac OS X 10.10 (using pyenv, anaconda)
How to install Theano on Mac OS X with homebrew
Very easy to install SciPy on Mac OS X
How to install caffe on OS X with macports
How to install python using anaconda
Install Sphinx on Mac OS X
How to install OpenCV on Mac
Install mitmproxy on Mac OS X
How to install Anaconda with pyenv
Install pgmagick on Mac OS X 10.9
Install opencv on Mac using Anaconda Navigator
How to install drobertadams / toggl-cli on Mac
Put Anaconda on your Mac using Pyenv
How to erase Python 2.x on Mac.
Install pyenv on mac
[Python] How to install OpenCV on Anaconda [Windows]
How to install / verify graphviz on anaconda / windows10
[CentOS7] Install anaconda using pyenv
Preparing to use aws cli on Mac OS X
Install module on Anaconda (Mac)
Try using E-Cell 4 on Windows 7 or Mac OS X
mac OS X 10.15.x pyenv Python If you can't install
Install PyQt5 with homebrew on Mac OS X Marvericks (10.9.2)
Memo on Mac OS X
How to install Python2.7 python3.5 with pyenv (on RHEL5 CentOS5) (2016 Nov)
Using multiple versions of Python on Mac OS X (2) Usage
Using NAOqi 2.4.2 Python SDK on Mac OS X El Capitan
Install anaconda on Mac → Add Library
Steps to install matplotlib on Mac
Install Python 3.7 Anaconda on MAC, but Python 2
Install Scipy on Mac OS Sierra
How to install VMware-Tools on Linux
How to install pycrypto on Windows
How to install PyPy on CentOS
How to install TensorFlow on CentOS 7
Install Python on CentOS using Pyenv
How to install Maven on CentOS
Steps to install python3 on mac
How to install Go on Ubuntu
Install Python on CentOS using pyenv
How to install music 21 on windows
(Beginner) Notes on using pyenv on Mac
How to rebuild python environment from pyenv on Mac environment (El Capitan)
Using multiple versions of Python on Mac OS X (1) Multiple Ver installation
Install Anaconda on Mac and upload Jupyter (IPython) notebook to Anaconda Cloud
Install lp_solve on Mac OS X and call it with python.
How to install aws-session-manager-plugin on Manajro Linux
Install matplotlib on OS X El Capitan
[Kivy] How to install Kivy on Windows [Python]
Installed aws-cli On Mac OS X Lion
How to install packages on Alpine Linux
How to install Anisble on Amazon Linux 2
How to install richzhang / colorization on Windows 10
How to install Apache (httpd) on CentOS7
How to install php7.4 on Linux (Ubuntu)
How to install Eclipse GlassFish 5.1.0 on CentOS 7
Install anaconda on a new Mac anyway
How to install Apache (httpd) on CentOS8
Personal Note Package to install on Anaconda
How to install NumPy on Raspberry Pi
How to install cx_Oracle on macOS Sierra