Anaconda, Conda and virtualenv

How to set up Anaconda, Conda, and Virtual Environments

Install Anaconda

Anaconda is an open data science platform powered by Python. Anaconda comes with distribution of Python and R and includes over 100 of the most popular Python, R and Scala packages for data science.

Use Graphical installer to install Anaconda powered by Python 3.6

Anaconda documentation

Pandas-datareader

pandas-datareader extracts data from various Internet sources into a pandas DataFrame. Docs

Start using pandas-datareader:

import pandas_datareader.data as web

Install latest release version via conda

conda install pandas-datareader

conda install -c anaconda pandas-datareader

Install latest release version via pip

pip install pandas-datareader

Conda

Conda is a package manager, just like pip, is used for updating Anaconda packages.

Conda documentation

If you get an error:

conda is not recognized as internal or external command.

For Windows

Go to:

Go to Control Panel\System and Security\System\Advanced System Settings\Environment Variables

and check path values, your user variable should contain

Path=..\Anaconda3\Scripts

Usually it looks like this:

C:Users\user.user\Anaconda3\Scripts

For Mac

Go to .bashrc, or sometimes to .profile, or.bash_profile and make sure PATH is right.

PATH: PATH="/Users/computer_name/anaconda/bin"

Virtual environments with Conda

Whithin you directory in the terminal/shell, where you want to launch virtualenv, type:

conda create -n env python=3.6 anaconda

to activate virtualenv:

source activate env

to install package:

conda install -n env [package]

to deactivate virtualenv:

source deactivate

Yelp Facebook LinkedIn YouTube Twitter Instagram