Sep-01-2023, 07:48 AM
(This post was last modified: Sep-01-2023, 07:48 AM by Gribouillis.)
(Sep-01-2023, 05:47 AM)Pedroski55 Wrote: I don't add the path permanently to $PATH because I don't use them very frequently.Dont mistake the Module Search Path with the environment variable $PATH, they are completely different things.
What you could do is put them in a package that would be permanently available for example
Output:myPython
└── packages
└── infrequent
├── __init__.py # add this file to make infrequent a package (an empty file suffices)
├── score_oralsOMR.py
└── ... others.py
Then you permanently add '/home/pedro/myPython/packages/'
to sys.path
by editing your usercustomize.py
module for example, then you can write in your scriptsfrom infrequent import score_oralsOMRAs for module
usercustomize
, if it doesn't already exist, create usercustomize.py
in the directory returned by the commandOutput:python -c "import site; print(site.getusersitepackages())"
In usercustomize.py
, add the linesimport site site.addsitedir('/home/pedro/myPython/packages')