How to fix the python path

瘦欲@ 提交于 2019-12-02 06:57:22
Ivan Kolodyazhny

You need to modify the sys.path array. It is initialized from the Python defaults and the environment variable "PYTHONPATH": http://docs.python.org/library/sys.html#sys.path

To append your directory the active path:

import sys;
sys.path.append("/path/to/your/dir")

Here's another useful tip:

Look under your ~/.local folder. There may be a homebrew.pth (or *.pth) file under ~/.local/lib/ which may cause issue by overriding the python path.

If unsetting $PYTHONPATH doesn't fix your issue, try removing the:

~/.local folder.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!