5
6

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

ubuntu16.04でpython3環境構築

Last updated at Posted at 2016-11-29

自分のubuntu16.04のpython環境構築うろ覚え.
特に新しいコト無いです.

pyenv virtualenvの導入

参考:Ubuntuにpythonと機械学習のライブラリをセットアップ
参考:PyenvによるPython3.x環境構築(CentOS, Ubuntu)

sudo apt-get install gcc g++ make git openssl libssl-dev libbz2-dev libreadline-dev libsqlite3-dev

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

python3環境構築

pyenv install 3.5.1
pyenv rehash
pyenv global 3.5.1
mkdir ~/workPython3

~/workPython3$ pyenv virtualenv 3.5.1 3.5.1_work
~/workPython3$ pyenv local 3.5.1_work
(3.5.1_work) foo@Ubuntu16.04:~/workPython3$ pip install numpy

問題無し.

(3.5.1_work) foo@Ubuntu16.04:~/workPython3$ pip install scipy

ここ(scipyのインストール)でBLASパッケージを何も入れておらずエラー.
どのBLASパッケージが良いのかよくわからないけど,とりあえずopenblasを入れる.

参考:ubuntu 14.04でBLASを使う

~$ sudo apt-get install libopenblas-dev

もう一回.

(3.5.1_work) foo@Ubuntu16.04:~/workPython3$ pip install scipy

今度は問題無し.

5
6
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
5
6

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?