编辑python用eclipse的哪个版本_在Eclipse中为不同的项目使用不同版本的python

So, I'm slowly working in some Python 3.0, but I still have a lot of things that rely on 2.5.

But, in Eclipse, every time I change projects between a 3.0 and a 2.5, I need to go through

Project -> Properties -> project type.

Issue 1: if I just switch the interpreter in the drop down box, that doesn't seem to change anything. I need to click "click here to configure an interpreter not listed", and UP the interpreter I wish to use.

Issue 2: That would be fine if I was switching to 3.0 for every project for the rest of my life, but I still am doing a lot of switching between projects and I don't see that changing anytime soon. So, I'm just trying to save a few operations.

Is there a way to configure Eclipse so that it remembers which interpreter I want associated with which project?

What if I created an entirely new workspace? Is "interpreter" a property of a workspace?

Also, it doesn't seem to matter what I choose when I create a new project via File -> New -> Pydev Project. Whatever I last selected through "Properties" is what eclipse is using.

This is Eclipse 3.4.0, running in Windows XP.

解决方案

You can set the interpreter version on a per-script basis through the Run Configurations menu.

To do this go to Run -> Run Configurations, and then make a new entry under Python Run. Fill in your project name and the main script, and then go to the Interpeter tab and you can pick which interpreter you want to use for that script.

I've used this to have Python 2.2, 2.5, and 3.0 projects in the same workspace.

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值