It seems that almost all of Python's numerical calculation libraries have been migrated to Python3 since 2012, so I tried to build an environment with Python3.
Recently, pyenv seems to be the standard for installing and using multiple versions of Python. It's easy because you can use Homebrew on Mac.
brew install pyenv
↓ Don't forget to write this as .zshrc.
export PYENV_ROOT="$HOME/.pyenv"
export PATH="$PYENV_ROOT/bin:$PATH"
eval "$(pyenv init -)"
You can see a list of versions that can be installed with pyenv install.
pyenv install
...
anaconda-1.9.1
...
...
miniconda-3.0.5
...
...
miniconda3-3.0.5
...
So I found anaconda and miniconda, so I thought I would use virtualenv at first, but decided to go with pyenv only.
Install miniconda3 and
pyenv install miniconda3-3.0.5
pyenv global miniconda3-3.0.5
Maybe I needed pyenv rehash
here.
Install other libraries with the conda command.
conda install numpy scipy matplotlib ipython pandas
conda install pyzmq Jinja2 tornado
(The one in the back seems to be necessary for ipython notebook)
You should need pyenv rehash
again here. (If you do ʻeval "$ (pyenv init-)" , it will also do
pyenv rehash`, so if you write this in zshrc etc., you can just launch another shell)
You don't need to build your own because you just installed the pre-built and distributed packages. great.
Everyone seems to think that building a numerical calculation environment for Python is troublesome, and Anaconda is made as a complete package. Anaconda has an installer for Mac, but you can also install the library etc. by installing only the minimum tool called miniconda. This time I used miniconda3 which is based on Python3.
There is also an all-in-one package called Enthought Python Distribution (EPD), which I used to use. It's called Canopy now, but it doesn't seem to support Python 3 yet.
Recommended Posts