How to delete a certain path in sys.path in anaconda env (base)?

不想你离开。 提交于 2020-08-10 18:50:07

问题


I have installed a package with

python setup.py install --user

It looks it had been done in anaconda (base), though I can't remember. The module was installed in $HOME/.local/lib/python3.6/site-packages and the path is included in sys.path in anaconda (base). But even though I make another env, the path is still included in sys.path in new env. How can I completely remove the path?

In the installed directory ($HOME/.local/.../site-packages), there are only two files of module directory and ...egg-info file. There is no other files such as *pth file.

In anaconda env (base), python setup.py install will install at

  • $HOME/anaconda3/lib/python3.6/site-packages

And after conda activation env_name, it will install at

  • $HOME/anaconda3/envs/env_name/lib/python3.6/site-packages

And both are not mixed in sys.path. So no need to use --user option in anaconda. '--user' option is needed to write at home rather than root. The problem is that the path to ~/.local/.. always remains in front of the above two paths so I want to remove the path to .local completely.

来源:https://stackoverflow.com/questions/63011104/how-to-delete-a-certain-path-in-sys-path-in-anaconda-env-base

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