I decided to do machine learning at work, so make a note of the setup method.
Install the modules required to install python first.
sudo aptitude install gcc g++ make openssl libssl-dev libbz2-dev libreadline-dev libsqlite3-dev
Use pyenv and pyenv-virtualenv so that versions and libraries can be switched for each directory.
git clone https://github.com/yyuu/pyenv.git ~/.pyenv
git clone https://github.com/yyuu/pyenv-virtualenv.git ~/.pyenv/plugins/pyenv-virtualenv
echo 'export PYENV_ROOT="$HOME/.pyenv"' >> ~/.bashrc
echo 'export PATH="$PYENV_ROOT/bin:$PATH"' >> ~/.bashrc
echo 'eval "$(pyenv init -)"' >> ~/.bashrc
echo 'eval "$(pyenv virtualenv-init -)"' >> ~/.bashrc
source ~/.bashrc
pyenv install 3.5.1
pyenv rehash
pyenv global 3.5.1
mkdir work
cd work
pyenv virtualenv 3.5.1 3.5.1_work
pyenv local 3.5.1_work
pip install numpy
pip install scipy
pip install scikit-learn
pip install gensim
pip freeze
If you check with, the list of installed libraries will be displayed only in the work folder.
pip freeze
boto==2.40.0
bz2file==0.98
gensim==0.12.4
...
mecab
Since I will do text system, I also install mecab.
sudo aptitude install libmecab-dev
sudo aptitude install mecab mecab-ipadic-utf8
mecab --version
pip install mecab-python3
Recommended Posts