Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
有没有办法在我 cd 进入目录时自动修改 PYTHONPATH。
我的工作站上通常有多个项目,每当我在其中一个目录中时,我希望该项目的 src/ 覆盖 PYTHONPATH 中的其他 src 目录。
您是否尝试在要“覆盖”的其他路径之前将“./src”添加到 PYTHONPATH?那应该行得通。(没有用 Python 尝试过,但大多数“路径”列表都允许使用相对路径。)