Jul-29-2022, 05:09 AM
First do this
You could also create a specific directory, for example
>>> import site >>> site.getsitepackages() ['/usr/local/lib/python3.8/dist-packages', '/usr/lib/python3/dist-packages', '/usr/lib/python3.8/dist-packages']You can store your python modules in one of the directories on the returned list to make them available to all users.
You could also create a specific directory, for example
Output:mkdir /usr/local/lib/python3.8/our-site-packages
Then>>> import sitecustomize >>> sitecustomize <module 'sitecustomize' from '/usr/lib/python3.8/sitecustomize.py'>Edit sitecustomize.py and add this
import site site.addsitedir('/usr/local/lib/python3.8/our-site-packages')Then use this directory for your modules.