Anaconda is a Data Science Python Distribution which includes:
- Python
- Python Standard Modules
- The Numeric Python library – numpy
- The Python and Data Analysis library – pandas
- The matrix plotting library – matplotlib
This tutorial will look at importing these modules and libraries and what it means physically.
Anaconda PowerShell Prompt
Open the Anaconda PowerShell Prompt from the Start Menu:

By default it will open in %USERPROFILE%:


Notice the Anaconda PowerShell Prompt begins with (base)
, this means the (base) Python environment is selected:

This is the python.exe found in the Anaconda3 folder:


The Anaconda PowerShell Prompt uses the Programming Language PowerShell PS
by default:

The >
indicates a new prompt:

The command prompt has the following syntax:
command option -p parametervalue1

command option --parametername2 parametervalue2

command option --parametername3

Python
To launch Python from the Anaconda PowerShell Prompt input:
python

Notice details about the Python version display alongside a new Prompt >>>
.
Python uses the following functional syntax which is different to the command line syntax seen above:
function(value1, arg2=value2)

Note that these are two different programming languages.
Importing Libraries
Notice the base Python environment has a Lib folder:

This contains the Python standard modules such as email:

If the module is examined it has a __init__.py file which is the default Python file imported when a folder is referenced.

The module can be imported using:
import email
And the path of the physical file can be examined using the data model attribute __file__:
email.__file__

Note every \ is replaced with \\, as \ is used to insert an escape character in a Python string, in this case the escape character to be inserted is also \.
The email standard module has submodules which can also be accessed using a .
and in Python the .
essentially means belonging to this object. Note that the .py
file extension is not included in an import statement and therefore there is no confusion with the .
used to indicate a file extension.
For example:
email.charset
would reference the charset.py in this email folder.
Some standard modules are smaller and are not contained in a folder. For example the datetime module is a single datetime.py file:

It can be imported and details of its file can be examined using:
import datetime datetime.__file__

The third-party data science libraries are found in the site-packages folder:

There is normally a folder that is the name of the library containing the Python script files alongside a folder that states the version:

The numpy library has a __init__.py file which is the Python file imported when numpy is imported:

As numpy is very commonly used it is typically imported using the 2 letter alias:
import numpy as np np.__file__

The pandas library has a __init__.py file which is the Python file imported when pandas is imported:


As pandas is very commonly used it is typically imported using the 2 letter alias:
import numpy as pd pd.__file__

The matplotlib library has a __init__.py file:


However typically only a module of this library is used called pyplot:

As pyplot is very commonly used it is typically imported using the 4 letter alias:
import matplotlib.pyplot as plt plt.__file__

The locations of these modules and libraries can be seen together:

To exit python use the function exit:

Notice because this is a function it is followed by parenthesis.
To exit the Anaconda PowerShell Prompt use the command exit:

Notice there is no parenthesis.
There is a difference in syntax as Python and PowerShell are two different programming languages.