Installing Anaconda and libraries
One of the most popular environment managers for users is Anaconda. With Anaconda, it's straightforward to set up, switch, and delete environments. Therefore, one can run Python 2 and Python 3 on the same machine and switch between different installed versions of installed libraries if needed. In this book, we purely focus on Python 3 and every recipe can be run within one environment: environment-python-deep-learning-cookbook
.
How to do it...
- You can directly download the installation file for Anaconda on your machine as follows (adjust your Anaconda file accordingly):
curl -O https://repo.continuum.io/archive/Anaconda3-4.3.1-Linux-x86_64.sh
- Next, run the bash script (if necessary, adjust the filename accordingly):
bash Anaconda3-4.3.1-Linux-x86_64.sh
Follow all prompts and choose 'yes' when you're asked to to add the PATH to the .bashrc
file (the default is 'no').
- Afterwards, reload the file:
source ~/.bashrc
- Now, let's set up an Anaconda environment. Let's start with copying the files from the GitHub repository and opening the directory:
git clone https://github.com/indradenbakker/Python-Deep-Learning-Cookbook-Kit.git cd Python-Deep-Learning-Cookbook-Kit
- Create the environment with the following command:
conda env create -f environment-deep-learning-cookbook.yml
- This creates an named
environment-deep-learning-cookbook
and installs all libraries and dependencies included in the.yml
file. All used in this book are included, for example, NumPy, OpenCV, Jupyter, and scikit-learn. - Activate the environment:
source activate environment-deep-learning-cookbook
- You're now ready to run Python. Follow the next recipe to install Jupyter and the deep learning frameworks used in this book.