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:



Setuptools is a way of installing Python packages.

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



pip3 install --user weasyprint