Permanently add a directory to PYTHONPATH?

前端 未结 19 1794
别那么骄傲
别那么骄傲 2020-11-22 01:12

Whenever I use sys.path.append, the new directory will be added. However, once I close python, the list will revert to the previous (default?) values. How do I

19条回答
  •  佛祖请我去吃肉
    2020-11-22 01:37

    On linux you can create a symbolic link from your package to a directory of the PYTHONPATH without having to deal with the environment variables. Something like:

    ln -s /your/path /usr/lib/pymodules/python2.7/
    

提交回复
热议问题