Using PyPI

PyPI is the Python Package Index.

Don’t install anything from PyPI as root. Use a virtual environment:

sudo yum install python-setuptools python-virtualenv
virtualenv /opt/myapp
source /opt/myapp/bin/activate
# Now install anything from PyPI into this virtual environment

(Fedora) To install a Python3 PyPI package into your home directory:

pip3 install --user my-package-name

Using pip

If a python upgrade has messed up pip, then you can run pip against a specific version of Python:

python3.5 -m pip <command> <args>

You can also edit the pip script and modify the shebang line at the top:

#!/usr/local/opt/python3/bin/python3.6

Setuptools

Setuptools is a way of installing Python packages.

They will usually be installed into ~/.local/bin.

Packages

Weasyprint

pip3 install --user weasyprint