Friday, August 4, 2017

Installing scikit-learn on linux



Scikit-learn requires:
Python (>= 2.6 or >= 3.3),
NumPy (>= 1.6.1),
SciPy (>= 0.9).

Python: often installed in build-in linux distro

You should  use pip to install Numpy and Scipy

sudo apt-get install pip
pip install Numpy
pip install Scipy
pip install -U scikit-learn

bonus: (phải tự mò ra, khổ vãi, open source thì đi cùng với vấn đề là dependency - không biết cái mã nguồn naỳ cần những cái dependency nào...)

cài pip (python package index)
sudo apt-get install pip

update pip
pip install --upgrade pip

xem vị trí các module Numpy, Scipy, scikit-learn
pip list
pip show Numpy
pip show Scipy
pip show scikit-learn

thiết lập sys.path của python trỏ đến các thư mục chứa module
$python
>>>import sys
>>>sys.path.append('path/to/the/folder/that/contains/module')

No comments:

Post a Comment