How to install pipx and pip in Solus
pipx is a tool is a great tool for installing and running end-user applications written in Python. pipx is using pip, but focused on installing and managing Python packages that can be run from the command line directly as applications.
Installation of pipx in Solus system is very easy. just run following command in terminal:
$ python3 -m pip install --user -U pipx
Output:
Collecting pipx
Downloading https://files.pythonhosted.org/packages/c3/63/b461c6996147fe72f7af6a1e108c817a8fa41d9bd744863b4993c8788553/pipx-0.15.1.3-py3-none-any.whl
Collecting argcomplete<2.0,>=1.9.4 (from pipx)
Downloading https://files.pythonhosted.org/packages/82/7d/455e149c28c320044cb763c23af375bd77d52baca041f611f5c2b4865cf4/argcomplete-1.11.1-py2.py3-none-any.whl
Collecting userpath (from pipx)
Downloading https://files.pythonhosted.org/packages/8a/72/07927efb668a0aa0cef502dbe4da442ac9598f19344bca9a3eb9bd062ec1/userpath-1.3.0-py2.py3-none-any.whl
Collecting importlib-metadata<2,>=0.23; python_version == "3.7" (from argcomplete<2.0,>=1.9.4->pipx)
Downloading https://files.pythonhosted.org/packages/ad/e4/891bfcaf868ccabc619942f27940c77a8a4b45fd8367098955bb7e152fb1/importlib_metadata-1.6.0-py2.py3-none-any.whl
Collecting click (from userpath->pipx)
Downloading https://files.pythonhosted.org/packages/dd/c0/4d8f43a9b16e289f36478422031b8a63b54b6ac3b1ba605d602f10dd54d6/click-7.1.1-py2.py3-none-any.whl (82kB)
|████████████████████████████████| 92kB 415kB/s
Collecting distro; platform_system == "Linux" (from userpath->pipx)
Downloading https://files.pythonhosted.org/packages/25/b7/b3c4270a11414cb22c6352ebc7a83aaa3712043be29daa05018fd5a5c956/distro-1.5.0-py2.py3-none-any.whl
Collecting zipp>=0.5 (from importlib-metadata<2,>=0.23; python_version == "3.7"->argcomplete<2.0,>=1.9.4->pipx)
Downloading https://files.pythonhosted.org/packages/b2/34/bfcb43cc0ba81f527bc4f40ef41ba2ff4080e047acb0586b56b3d017ace4/zipp-3.1.0-py3-none-any.whl
Installing collected packages: zipp, importlib-metadata, argcomplete, click, distro, userpath, pipx
WARNING: The script distro is installed in '/home/dima/.local/bin' which is not on PATH.
Consider adding this directory to PATH or, if you prefer to suppress this warning, use --no-warn-script-location.
WARNING: The script userpath is installed in '/home/dima/.local/bin' which is not on PATH.
Consider adding this directory to PATH or, if you prefer to suppress this warning, use --no-warn-script-location.
WARNING: The script pipx is installed in '/home/dima/.local/bin' which is not on PATH.
Consider adding this directory to PATH or, if you prefer to suppress this warning, use --no-warn-script-location.
Successfully installed argcomplete-1.11.1 click-7.1.1 distro-1.5.0 importlib-metadata-1.6.0 pipx-0.15.1.3 userpath-1.3.0 zipp-3.1.0
WARNING: You are using pip version 19.2.3, however version 20.0.2 is available.
You should consider upgrading via the 'pip install --upgrade pip' command.
Pipx installation script installed pip as well, but in installation logs we see:
WARNING: You are using pip version 19.2.3, however version 20.0.2 is available.
You should consider upgrading via the 'pip install --upgrade pip' command.
Upgrading pip
First of all, let's upgrade our repository info:
$ sudo eopkg up
Then you can check, if PATH is set up for pipx. Try running command:
$ pipx --version
In case PATH is set, you'll see version of pipx:
dima@edustorage ~ $ pipx --version
0.15.1.3
Setting PATH for pipx
In case PATH is not set, you will se this message:
bash: pipx: command not found
For simplicity of further work, let's set it. Normally, pipx will be installed in ~/.local/bin :
$ ls ~/.local/bin
Is it working? Let's check:
$ cd ~/.local/bin
$ ./pipx --version
output:
Good. Pipx is working. Now let's set up PATH to run pipx by executing only "pipx" regardless the directory we're currently in.
The only thing we have to do is to add alias. Open ~/.bashrc file and add row "alias pipx='~/.local/bin/pipx'. You can use any text editor you want (nano, vim). I use vim, for example.
$ vim /.bashrc
Save the file.
And update .bashrc:
$ source ~/.bashrc
Now we can call pipx by command 'pipx' from any location in our system. For example:
$ pipx --version