Tag Archives: HOW TO

HOW TO: Python libraries

This little tutorial is for anyone who is new to Python and doesn’t know how to install libraries yet.

The easiest way to install a new Python library is to use PIP.

Open a command prompt, and enter

pip install package_name

… to install a new library.

To update one, use the ‘–upgrade’ option:

pip install package_name --upgrade

When any errors occur, try updating PIP the same way:

pip install pip --upgrade

If a library isn’t available through PIP, you have to install it yourself.

Download the library and extract it, then open a command prompt in your new directory (shift + right click inside the folder -> Open command prompt here). Install it by running:

python setup.py install

If there is no ‘setup.py’ script available, you could try to just copy the library into your Python site-packages folder. Most commonly this is installed in C:\Python3x\Lib\site-packages.