Pipx Tutorial

Imagine if you could try out a python application without actually installing it. Imagine if you could also install a CLI application in an isolated environment that will not affect your entire system.

This is where Pipx comes to the rescue. Pipx is a wonderful package that fixes this issue.

It allows us to install and run Python Applications in isolated environments on our system without any hustle.

With Pipx you can install any python package that has an entrypoint for console scripts .ie. python applications that have a command line interface support.

Upon installation pipx creates an isolated virtual environment where it will install all the CLI applications you install with pipx.

Let us explore Pipx in this tutorial.

Installing Pipx
python3 -m pip install --user pipx

You can then ensure that pipx has been added to your environment variables or path by

python3 -m pipx ensurepath
Usage of Pipx

To install a python application with pipx you can use the following

pipx install <Your_CLI_Package>

Example

pipx install covidcli

You can then check out the installed application just as you would normally do

covidcli --help

 

In case you want to check for all the available applications  installed via pipx you can use the list command to get a list of all the CLI applications

pipx list
Running Python Application Temporally

Pipx also offers the possibility to run apps without installing them either from PyPI or from a direct URL

pipx run pycowsay
pipx run path_to_application_file.py

You can also upgrade a single python application installed in your isolated environment or the entire packages with

pipx upgrade Your_PKG
pipx upgrade-all

In case you also want to uninstall a python application you can use

pipx uninstall Your_PKG

You can check the video tutorial below

 

Thanks for your attention

Jesus Saves

By Jesse E. Agbe(JCharis)

 

 

Leave a Comment

Your email address will not be published. Required fields are marked *