从python路径永久删除目录 [英] permanently remove directory from python path
本文介绍了从python路径永久删除目录的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我最近添加了一些东西到我的python路径,我不想使用:
I recently added some things to my python path that I don't want there using:
export PYTHONPATH=$PYTHONPATH:/my/path
您可以使用 sys.path.remove
删除路径中的某些内容,但不是100%永久,就像我在上面的命令行语句中添加它一样。
You can use sys.path.remove
to remove something in the path, but it's not 100% permanent like the way I added it with the command line statement above.
我可以如何从python路径永久移除目录?
what can I do to permanently remove directories from the python path?
推荐答案
正确的行是add / my / path to PYTHONPATH,所以它应该是相当安全的,即使你的.bashrc。周围有其他人。
Exactly as it stands, what the line says is "add /my/path to PYTHONPATH", so it should be fairly safe even if there are others around your .bashrc.
这篇关于从python路径永久删除目录的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文