Permanently add a directory to PYTHONPATH?

前端 未结 19 1341
别那么骄傲
别那么骄傲 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条回答
  •  旧时难觅i
    2020-11-22 01:35

    I added permanently in Windows Vista, Python 3.5

    System > Control Panel > Advanced system settings > Advanced (tap) Environment Variables > System variables > (if you don't see PYTHONPATH in Variable column) (click) New > Variable name: PYTHONPATH > Variable value:

    Please, write the directory in the Variable value. It is details of Blue Peppers' answer.

提交回复
热议问题