Installing A Python Based Machine Learning Environment in Windows 10
Installing A Python Based Machine Learning Environment in Windows 10
Frank Ceballos
Dec 18, 2018 · 6 min read
Sign up with
The following set of instructions wereFacebook
compiled from across the web
and written for a Windows 10 OS. Last tested on 02/09/2019.
Already have an account? Sign in
https://towardsdatascience.com/installing-keras-tensorflow-using-anaconda-for-machine-learning-44ab28ff39cb 1/9
9/18/2019 Installing a Python Based Machine Learning Environment in Windows 10
Overview
When I first got into machine learning it took me a few hours to figure how to properly
set my Python environment. Out of frustration, I decided to write this post to help
anyone going through the process. We will start by installing Anaconda Navigator
which will allow us to create independent environments, this will come really handy.
Additionally, with Anaconda we can easily install compatible Python modules with
very simple commands. Finally, we can use Anaconda to get Spyder — a scientific
Python development environment. If you follow the step-by-step procedure shown
below, you will have installed Tensorflow, Keras, and Scikit-learn in no time.
Getting Anaconda
In order to start building your machine learning (ML) models with Python, we will
start by installing Anaconda Navigator. Anaconda provides an efficient and easy way to
install Python modules on your machine. So let’s get started.
1. Download and install the latest version of Anaconda Navigator for your operating
system.
Get one more story in your member preview when you sign up. It’s free.
2. Proceed with the installation wizard but skip the step where you need to download
Sign up with Google
and install VS, we will do this later. Additionally, make sure to install Anaconda
Navigator for a single user. At the time this set of instructions were written, installing
Sign up with Facebook
VS with the setup wizard made my Anaconda installation fail. Additionally, installing
Already have an account? Sign in
https://towardsdatascience.com/installing-keras-tensorflow-using-anaconda-for-machine-learning-44ab28ff39cb 2/9
9/18/2019 Installing a Python Based Machine Learning Environment in Windows 10
Anaconda for All Users might lead to problems. For example, you won’t be able to
install any modules because Anaconda won’t have the necessary privileges.
Make sure you install Anaconda to the current user else you might face problems down the road.
Get one more story in your member preview when you sign up. It’s free.
or two.
After you install VS Code, you will be able to see a Launch button under the VS Code panel.
4. Close Anaconda Navigator and launch Anaconda Prompt. Launch Anaconda prompt
by searching for it in the windows search bar. The following terminal should open.
Notice that this will open on the base Anaconda environment.
Get one more story in your member preview when you sign up. It’s free.
5. Downgrade Python to a Keras & Tensorflow compatible version. Anaconda will start
Sign up with Facebook
to look for all the compatible modules for Python 3.6. This might take a few minutes.
To downgrade to Python 3.6 Already
use thehave
following command:
an account? Sign in
https://towardsdatascience.com/installing-keras-tensorflow-using-anaconda-for-machine-learning-44ab28ff39cb 4/9
9/18/2019 Installing a Python Based Machine Learning Environment in Windows 10
After the environment is resolved, Anaconda will show you all the packages that will be downloaded.
6. Create a new conda environment where we will install our modules to built our
models using the GPU. To do so, execute the following command:
Note: Ensure that you have a NVIDIA graphics card. If you don’t, install the CPU version of
Keras.
If you want to use your CPU instead, execute the following command:
Follow the instructions displayed on the terminal. Conda environments give the user
Gettoone
the liberty more
install story
very in your
specific member
modules preview
that when you sign
are independent up. It’sPersonally,
habitats. free. I
created two environments. One where I can built my models using the CPU and the
Sign up with Google
other where I can built my models using the GPU. For more information about conda
environments, I suggest you take a look at the official documentation.
Sign up with Facebook
https://towardsdatascience.com/installing-keras-tensorflow-using-anaconda-for-machine-learning-44ab28ff39cb 5/9
9/18/2019 Installing a Python Based Machine Learning Environment in Windows 10
conda deactivate
Do not deactivate the environment yet, we are about to install all the good stuff.
8. To install Keras & Tensorflow GPU versions, the modules that are necessary to create
our models with our GPU, execute the following command:
If you want to use your CPU to built models, execute the following command instead:
A lot of computer stuff will start happening. Once the madness stops, we can move on.
Don’t close anything yet.
Getting Spyder
Get one andin other
more story Python
your member Packages
preview forup.Machine
when you sign It’s free.
Learning / Deep Learning
Sign up with Google
Now you might want some piece of software to write and execute your Python scrips.
You can always use Vim to write and edit your Python scrips and have another terminal
Sign up with Facebook
open to execute them. However, you will be missing out on all the cool features Spyder
haves to offer. Already have an account? Sign in
https://towardsdatascience.com/installing-keras-tensorflow-using-anaconda-for-machine-learning-44ab28ff39cb 6/9
9/18/2019 Installing a Python Based Machine Learning Environment in Windows 10
9. Install Spyder.
10. Install Pandas. Pandas is a library that is extremely powerful and allows you to
easily read, manipulate, and visualize data.
If you want to read Excel files with Pandas, execute the following commands:
11. Install the Seaborn library. Seaborn is an amazing library that allows you to easily
visualize your data.
Get one more story in your member preview when you sign up. It’s free.
Anaconda LibraryNameYouWant Install
https://towardsdatascience.com/installing-keras-tensorflow-using-anaconda-for-machine-learning-44ab28ff39cb 7/9
9/18/2019 Installing a Python Based Machine Learning Environment in Windows 10
spyder
To ensure everything was installed correctly, execute the following lines of code on the
python console:
If you see no ModuleImport errors, you’re now ready to start building machine learning
based models using Keras, Tensorflow, and Scikit-Learn.
Get one more story in your member preview when you sign up. It’s free.
Python Machine Learning TensorFlow Keras Scikit Learn
Sign up with Google
https://towardsdatascience.com/installing-keras-tensorflow-using-anaconda-for-machine-learning-44ab28ff39cb 8/9
9/18/2019 Installing a Python Based Machine Learning Environment in Windows 10
Get one more story in your member preview when you sign up. It’s free.
https://towardsdatascience.com/installing-keras-tensorflow-using-anaconda-for-machine-learning-44ab28ff39cb 9/9