Package: pip-safe
pip-safepip-safeis thesafeand easy pip package manager for command-line apps from PyPi.Synopsyspip-safe install lastversion
lastversion linuxWhyUsingpip install ...outside virtualenvcan simply break your system.
So many tutorials out there blindly recommend that without any note of having to use virtualenvs,
and so many peopledojust run that without any knowledge ofwhata virtualenv is.If you run an OS which distributes Python packages viayum,apt, etc. youwillbreak your
system sooner or later, if you keep usingpipas root or sudo.You either have to package the Python-based program yourself, or have to use a virtualenv for
installing it. Everything else is a risk of breakage.pip-safeis here to make itvery easyto install command-line apps from PyPi without having to
package anything.InstallationPre-RequisitesConfigure yourPATHto execute stuff from~/.local/binand/usr/local/bin.Placeexport PATH=$PATH:$HOME/.local/bin:/usr/local/binin your~/.bashrcthen runsource ~/.bashrcto apply to current shell.CentOS/RHEL  7, 8 and Fedora Linuxsudo yum -y install https://extras.getpagespeed.com/release-latest.rpm
sudo yum -y install pip-safeUsingpip-safecommand installs a program using Python 3, by default.If you require to run a legacy app using Python 2, runyum install pip2-safeto install Python 2
support. Then to install a Python 2 app, usepip2-safe install <app>. You can still usepip-safeas usual, for Python 3 apps.Other systemsPlease do not use these methods if packages forpip-safeare available!Installpip-safefor current userIf you installpip-safeusing this method, you can only install packages for current user,
but this method does not require root.Ensure~/.local/binis in yourPATH, then:mkdir -p ~/.virtualenvs
python3 -m venv ~/.virtualenvs/pip-safe
~/.virtualenvs/pip-safe/bin/pip install pip-safe
mkdir -p $HOME/.local/bin
ln -s $HOME/.virtualenvs/pip-safe/bin/pip-safe $HOME/.local/bin/pip-safeSystem-wide installation ofpip-safeWhenpip-safeis installed system-wide, you can install both system-wide and user packages with it.Ensure/usr/local/binis in yourPATH, then:mkdir -p /opt/pip-safe
python3 -m venv /opt/pip-safe/pip-safe
/opt/pip-safe/pip-safe/bin/pip install pip-safe
ln -s /opt/pip-safe/pip-safe/bin/pip-safe /usr/local/bin/pip-safeUsageSafely install and remove PyPi (pip) programs without breaking your system

positional arguments:
  <command>        Command to run, e.g. install, update, remove or list
  package-name

optional arguments:
  -h, --help       show this help message and exit
  -v, --verbose
  -y, --assumeyes
  --system         Install for all users
  --version        show program's version number and exitInstalling a programpip-safe install <name>To see what's going on under the hood, pass--verboseflag.There is limited support for installing directly from Git URLs, e.g.:pip-safe install git+https://github.com/dvershinin/lastversion.gitGlobal installationBy default, programs are installed to~/.local/bin/<package>(for current user).
For a system-wide installation, use--system:sudo pip-safe install --system lastversionThis installs a package to/opt/pip-safe/<package>and symlinks its executable to/usr/local/bin,
so it's still safe :-)Removing a programpip-safe remove <name>Updating a programpip-safe update <name>Listing installed packagespip-safe listWithpip-safe, you can easily install command line programs from PyPi,
while not worrying about breaking your system.Howit installs each program into its own virtualenv, and symlinks whichever
executables it has over to~/.local/bin/It is that easy and I don't know why nobody did this before.CaveatsOnly pure Python apps will work absolutely reliably, because others might requiresystemlibraries,
and we can't decipher what are thoseTested only with Python 3.6Helpful stuff used while creating pip-safeInvoking virtualenv from Python