简体   繁体   English

如何持久化Eclipse Pydev项目的PYTHONPATH设置?

[英]How to persist PYTHONPATH setting of an Eclipse Pydev project?

I can setup a working PYTHONPATH using project properties, but it seems like after every reboot, I have to manually reset it. 我可以使用项目属性设置有效的PYTHONPATH,但似乎每次重新启动后,都必须手动重置它。 Is there a good way to persist the PYTHONPATH associated with a project? 有没有一种好的方法来持久化与项目关联的PYTHONPATH?

When you set the PYTHONPATH for a project, pydev will create a .pydevproject file in the root of your project. 当您为项目设置PYTHONPATH时,pydev将在项目的根目录中创建一个.pydevproject文件。 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). 确保正确写入了文件(可能是您的项目为只读项目或类似的项目,可能会阻止PyDev在保留设置的位置写入该文件)。

If that's not your case, please take a look if there's something reported in your error log. 如果不是您的情况,请查看错误日志中是否报告了某些内容。

Maybe instead of tweaking your project properties, you should try to change your pydev's settings. 也许不要调整项目属性,而应尝试更改pydev的设置。 I found this tutorial .Take a look at no 3 . 我找到了本教程 。看一下No 3。

Hope it helps. 希望能帮助到你。

Then you create new pydev project you can select option like "Add project to your python path". 然后创建新的pydev项目,您可以选择“将项目添加到python路径”之类的选项。 If you want you can customize python's intepreter and associated libs. 如果需要,可以自定义python的解释器和关联的库。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM