Where is the recommended place to host small convenience modules for python

I have compiled a small collection of small handy special scripts that I would like to have for me in all my python projects and ipython interactive sessions. I would like to add and clear this collection without worrying about how to create setup.py files and install them formally. From the default sys.path directory listing, what is the right home for these scripts?

+4
source share
1 answer

The user's site directory should be the right directory for such things.

python -m site --user-site 

shows the correct path for your platform. Usually this is something like $HOME/.local/lib/python<version>/site-packages

You can even place the sitecustomize.py module sitecustomize.py , which will be automatically imported every time you start the line-to-line interface.

+4
source

Source: https://habr.com/ru/post/1489001/


All Articles