Anaconda, conda and virtualenv

Written by Art, June 18, 2017

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


Share with:

About author


Art

Art is a FinTech enthusiast who has a great passion for coding and teaching. He earned a M.Sc. from Adelphi University, Garden City, New York. Currently, he develops software for the financial services industry and leads classes and workshops in Python at PracticalProgramming.co

Web Scraping w/Python Livestream

We go through the whole process of gathering, storing and analyzing data from the Web

RSVP NOW