It is not directly connected to Python, but Pip uses it. Let’s start from the beginning. First you should understand, what the /usr
directory is used for:
In current Unices, /usr is where user-land programs and data (as opposed to ‘system land’ programs and data) are.
It should be used for data installed by the system, i.e. official packages of the distribution.
The /usr/local
directory mirrors the structure of the /usr
directory, but can be used by system administrators to install local or third party packages for all users.
The ~/.local
directory now has the same purpose just for a single user.
Usually you’ll install your packages with the default package manager using the /usr
directory. But since you’re using Pip as package manager for your Python modules, these are installed in ~/.local
.
So basically pip
might have created ~/.local
or just any other programm writing data to one of the directories located there. ~/.local/share
for example is used by most applications to store their data.