What is the purpose of $ HOME / .local

I noticed that I have $HOME/.local on my machine and it seems that this directory contains mainly material related to python, here is its full list (it is a bit long).

I would like to ask what action created this directory? I suppose it was pip install --user -r requirements.txt (below are the commands by which I understood this), but I am wondering if there are any other tools that store data here? I suppose if it was pip , then easy_install can do this or not? Are there any other tools you know about that uses this directory or is it pip exclusively?

The following command shows that some python module was imported from this directory, the output of the latter is here (it's a little long):

 marek@ubuntu :~$ python -c 'import mock; print mock.__file__' /home/marek/.local/lib/python2.7/site-packages/mock.pyc marek@ubuntu :~$ echo $PYTHONPATH marek@ubuntu :~$ tree .local/ | grep mock │  ├── mock-1.0.1.egg-info │  ├── mock.py │  ├── mock.pyc │  │  ├── mock.py │  │  ├── mock.pyc marek@ubuntu :~$ pip show -f mock --- Name: mock Version: 1.0.1 Location: /home/marek/.local/lib/python2.7/site-packages Requires: Files: Cannot locate installed-files.txt marek@ubuntu :~$ python -c 'import sys, pprint; pprint.pprint(sys.path)' ['', '/home/marek/.local/lib/python2.7/site-packages/nupic-0.3.0.dev0-py2.7-linux-x86_64.egg', '/usr/lib/python2.7/dist-packages', '/usr/lib/python2.7', '/usr/lib/python2.7/plat-x86_64-linux-gnu', '/usr/lib/python2.7/lib-tk', '/usr/lib/python2.7/lib-old', '/usr/lib/python2.7/lib-dynload', '/home/marek/.local/lib/python2.7/site-packages', '/usr/local/lib/python2.7/dist-packages', '/usr/lib/python2.7/dist-packages/PILcompat', '/usr/lib/python2.7/dist-packages/gtk-2.0', '/usr/lib/pymodules/python2.7', '/usr/lib/python2.7/dist-packages/ubuntu-sso-client'] marek@ubuntu :~$ python -v 2>&1 | tee modules 

The answer says that this directory should have $HOME/.local/bin/hg if it was created using pip , but I don't have this file. So was it created using pip or not?

+5
source share
1 answer

It is not directly related to Python, but Pip uses it. Let it start from the very beginning. You must first understand that the /usr directory is used for:

Current Unices / usr uses programs and data for users (as opposed to programs and system ground data).

It should be used for data installed by the system, i.e. official distribution packages.

The /usr/local directory reflects the structure of the /usr directory, but can be used by system administrators to install local or third-party packages for all users.

Now the ~/.local directory has the same purpose for only one user.

You usually install your packages using the default package manager using the /usr directory. But since you use Pip as the package manager for your Python modules, they are set to ~/.local .

Thus, basically pip could create ~/.local or any other program that writes data to one of the directories located there. ~/.local/share , for example, is used by most applications to store their data.

+6
source

All Articles