You had installed a version of Python under /usr/local
. You have now removed part of it. You're trying to use a part that's still present, but it isn't going to work without the part that you've removed.
Unless your installation was extremely messy in the first place, /usr/local/bin/pip
runs /usr/local/bin/python
which looks for library files under /usr/local/lib/python3.5
(assuming that it's Python version 3.5). If you want to run that version of Python, you can't remove /usr/local/lib/python3.5
. If you don't want to run that version of Python then you need to remove all of its files. This means removing /usr/local/bin/python
and all the files that were installed with it, such as /usr/local/bin/pip
. There are probably files in other directories as well, such as under /usr/local/man
or /usr/local/share/man
.
Uninstalling applications from /usr/local
is messy, which is why it's recommended to use a package manager — either get packages from a Linux distribution, or use stow. See Keeping track of programs Since in your case the damage has been done, you'll need to track down the files to remove manually. Look for files whose modification time is about the same.
Once you've purged that installation of Python under /usr/local
, running pip
will invoke /usr/bin/pip
which comes with your distribution (assuming that you've installed your distribution's Python packages — if you haven't, do it).