pipx, and virtual environments
Let’s put what we just learned into action.
Here are some exercises where you will install and test the tools that we just talked about.
pipx. You can also install one of the virtual environment tools, but using either the built-in
pyenv-virtualenvis perfectly fine
Install a newer version of Python using
pyenv. If you are already using the latest version, try to install an older one.
$ pyenv localand
$ pyenv shellcommands to see how they work.
Create a new virtual environment.
$ pip install cowsay(it’s a silly package that prints some ASCII image together with whatever text you ask it to say)
$ cowsay hello world
$ pip freeze
$ cowsay hello again
Install a package with
pipx. For example:
$ pipx install glances (glances is a pretty useful tool to see what’s going on on your computer)
$ pipx list
$ pipx uninstall glances) and install it with pip INSIDE the virtual environment.