Prepare your computer for for machine learning (Python)

Summary of what you are going to install:

  • python
  • numpy
  • scipy
  • scikit-learn
  • ipython

Step 1 – Update apt if needed:

sudo apt update

Step 2 – Install prerequisites:

sudo apt install build-essential checkinstall 
sudo apt-get install libreadline-gplv2-dev libncursesw5-dev libssl-dev libsqlite3-dev tk-dev libgdbm-dev libc6-dev libbz2-dev libffi-dev

Step 3 – Install python via APT repositories:

sudo add-apt-repository ppa:deadsnakes/ppa
sudo apt install python3.7

or alternatively, download and install manually:

cd /usr/src
sudo wget https://www.python.org/ftp/python/3.7.2/Python-3.7.2.tgz
tar -xf Python-3.7.2.tgz

Step 4 – Configure for optimizations:

cd Python-3.7.2 && sudo ./configure --enable-optimizations

Step 5 – Compile source code:

sudo make altinstall

Step 6 – Install machine learning libraries:

pip3.7 install --user numpy
pip3.7 install --user scipy
pip3.7 install --user scikit-learn
pip3.7 install --user ipython
pip3.7 install --user tensorflow
pip3.7 install --user pandas
pip3.7 install --user keras

References:

Leave a Reply