I want to permanently add a directory to the path to load the functions and modules that I will create in the future.
For example:
C:UsersXXXLib1
Inside it there would be a structure similar to the following one:
Lib1/
/m1/__init__.py
1.py
2.py
/m2/__init__.py
a.py
b.py
I want to use the libraries independently of where the current file path is located (ex: import lib1... m2.a(x,x,x) )
I'm using python 3 with anaconda3 on windows 10
Using the following commands, I achieve my objective, but when I close python the changes are not saved. I have to run them every time I open python again.
import sys
sys.path.append('C:UsersXXXLib1')
thanks in advance for your help
question from:
https://stackoverflow.com/questions/65909212/modifying-python-path-permanently 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…