问题
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