Lecture – Python Packages

Installing Python Packages

The Anaconda installation of Python comes with a large number of packages, however there will be times when you want to install more.  Package installation is a command line function so the first step is getting a command line.

By Default you can get to a Command Prompt in Windows 10 using the Start Menu – Windows System – Command Prompt. It is recommended to add this to the Taskbar.

If conda is installed, then you will simply be able to type conda and the installation commands to be able to perform the installations. If the file is not found (but Anaconda is installed) then you will need to add the location of the conda.exe to your PATH Environment variables.

Finding and Adding conda to the Path (only if conda does not run from command prompt)

conda.exe is very likely installed, but if it is not included in the Windows PATH environment variable, you will not be able to access it unless you are in the correct directory. If have multiple installations of python, you will also want to make sure you are using the correct version of conda for the installation of the packages. Let’s take a look. In the Start Menu on the Far left you should see the wheel for the System Settings – just above the Shutdown Icon. This will take you to the Setting Page

From there it is easiest to simply search on environment variables and select to Edit Enviironment Variables which should open to the Advanced Tab

From there the Environment Variables Link will open and you will be able to see the PATH in the list of Environment Variables.

The actual location of Conda is usually;

C:\ProgramData\Anaconda3\Scripts

The location of Anaconda is usually

C:\ProgramData\Anaconda3\

You can also easily find these locations by going to the Anaconda Prompt (in the Windows – Anaconda Prompt in the start menu and using the commands. This is shown.

where python
where conda

Once you have these locations you can add them to the environment variables for the PATH variable. You can do this in either User or System variables. If you do it under User – they will only work with your login.

Once you have done these steps you can open a command prompt and install packages.

Video on Steps

This video does great job of showing the steps in using pip and conda to install packages.

What Can I Install

My first suggestion is to open a command prompt and simply type

conda list

to see a list of packages that came with your Anaconda. Additionally you should look at the Python package index at

https://pypi.org/

to see a full list of registered python packages. Welcome to the rich world of python packages.