如何保留 Eclipse Pydev 项目的 PYTHONPATH 设置?

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/9249995/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-19 17:42:44  来源:igfitidea点击:

How to persist PYTHONPATH setting of an Eclipse Pydev project?

pythoneclipsepydev

提问by zer0stimulus

I can setup a working PYTHONPATH using project properties, but it seems like after every reboot, I have to manually reset it. Is there a good way to persist the PYTHONPATH associated with a project?

我可以使用项目属性设置一个有效的 PYTHONPATH,但似乎每次重新启动后,我都必须手动重置它。有没有一种好方法可以保留与项目关联的 PYTHONPATH?

采纳答案by Fabio Zadrozny

When you set the PYTHONPATH for a project, pydev will create a .pydevproject file in the root of your project. Make sure that file is being properly written (it could be that your project is read-only or something like that which could prevent PyDev from writing that file where the settings are persisted).

为项目设置 PYTHONPATH 时,pydev 将在项目的根目录中创建一个 .pydevproject 文件。确保文件被正确写入(可能是您的项目是只读的或类似的东西,这可能会阻止 PyDev 写入保留设置的文件)。

If that's not your case, please take a look if there's something reported in your error log.

如果这不是您的情况,请查看您的错误日志中是否报告了某些内容。

回答by kaiseroskilo

Maybe instead of tweaking your project properties, you should try to change your pydev's settings. I found this tutorial.Take a look at no 3 .

也许不是调整您的项目属性,您应该尝试更改 pydev 的设置。我找到了这个教程。看看没有 3。

Hope it helps.

希望能帮助到你。

回答by Denis

Then you create new pydev project you can select option like "Add project to your python path". If you want you can customize python's intepreter and associated libs.

然后您创建新的 pydev 项目,您可以选择“将项目添加到您的 python 路径”之类的选项。如果你愿意,你可以自定义 python 的解释器和相关的库。