Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
100% found this document useful (1 vote)
144 views

Python Setup For Machine Learning

This document provides installation instructions for various Python packages on Ubuntu 16.04 and Windows. For Ubuntu, it describes updating the system, installing Python development packages, and using pip to install packages like Numpy, Scipy, Matplotlib, etc. For Windows, it recommends using Anaconda to create a TensorFlow environment and install packages like TensorFlow, Keras and PyTorch.

Uploaded by

ffarazs
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
100% found this document useful (1 vote)
144 views

Python Setup For Machine Learning

This document provides installation instructions for various Python packages on Ubuntu 16.04 and Windows. For Ubuntu, it describes updating the system, installing Python development packages, and using pip to install packages like Numpy, Scipy, Matplotlib, etc. For Windows, it recommends using Anaconda to create a TensorFlow environment and install packages like TensorFlow, Keras and PyTorch.

Uploaded by

ffarazs
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 3

Installation Guide

The packages that need to be installed are:


● Numpy
● Scipy
● Matplotlib
● Tkinter
● Opencv
● Pillow
● H5py
● Sklearn
● Pandas
● Pytorch (version 0.1.12_2)

For Ubuntu 16.04


This guide is primarily for Ubuntu 16.xx versions but will also work with Ubuntu 18. All of the
given commands need to be run on the terminal.

The first task is to upgrade the system for that the following steps need to be done:
1. Update the repositories
sudo apt update
2. Upgrade the system
sudo apt upgrade
3. Remove outdated programs
sudo apt autoremove

Python 2.7 and 3 comes preinstalled in Ubuntu but we need to install their development
packages. For that run the following commands
For python 2.7
sudo apt install python-dev
For python 3
sudo apt install python3-dev

For installing tkinter package use the following commands


sudo apt install python-tk
sudo apt install python3-tk
We will use pip to install other packages. For installing pip
sudo apt install python-pip
sudo apt install python3-pip

Using pip the above-mentioned packages can be easily installed. For python 2.7 use the
following command
sudo -H pip2 install <package name>
For python 3 use the command
sudo -H pip3 install <package name>

For some packages we need to specify the version number as well for that we can use
sudo -H pip3 install <package name>==<version>

For eg:
sudo -H pip2 install keras
sudo -H pip2 install keras==2.0.0

For Windows
We will be using anaconda for installing the packages in windows.
The steps to installing anaconda are:
1. Download anaconda for python version 3.7 for 64-bit machine using this link:
https://repo.continuum.io/archive/Anaconda3-2018.12-Linux-x86_64.sh
2. Double click the downloaded file to launch the anaconda. You can follow these
instructions in some trouble or doubt during installation:
https://docs.anaconda.com/anaconda/install/windows/
3. After complete installation of anaconda. Search for "Anaconda Prompt" from the context
menu. Click on it to run.

To install tensorflow the steps are:


1. Type below command on anaconda prompt to create a tensorflow environment
conda create -n tensorflow_env tensorflow
2. After successfully creating the environment, activate the created tensorflow environment
using this command
conda activate tensorflow_env
3. Now Open Anaconda Navigator from search menu of windows. Run your created
tensorflow environment and install Spyder( where you can write and run your code),
which will be available in anaconda navigator itself.
4. For any additional package installation which is listed above, you can install via pip.
pip install keras

For installing pytorch first we need to activate the environment using the command in step 2.
Then install pytorch using the following command
conda install pytorch=0.4.1 -c pytorch

You might also like