aptana手动配置python环境_在Aptana Studio中本地运行Python 3

I recently installed Python 3.5.2 on Mac OS X El Capitan (Version 10.11.6). I (thought) I configured Aptana Studio 3 correctly so that it points at Python 3.5 when it runs any Python code. But I'm getting error messages even why I try to run simple commands.

If you take a look at the following screenshots:

You'll notice that printing(4+8) does print 12, but I get a red X to the left of the print command (which after hovering reveals "undefined variable: print"). I also get Traceback messages and TypeErrors. The same goes for when I try something more advanced, like creating a function and running tests:

I shouldn't be getting these error messages if Aptana is pointed at Python 3 correctly, right? You can see in the screenshots that Python 3.5 is in the same folder as the test.py file I'm using to run the code. I had followed this youtube tutorial to configure Python Interpreter in Aptana (she starts this around 1:30). Any help is greatly appreciated!

EDIT: Following these instructions on VectorWorks, I go to Preferences > PyDev > Interpreters > Python Interpreter and click on Advanced Auto-Config. The options that show up only include Python versions 2.6 and 2.7.

I don't understand why 3.5 isn't showing up? If I choose the second option under Python Interpreters (Python 1), it now displays Python 3 in the system library, but again when I click advanced auto config, it still only provides me with versions 2.6 and 2.7.

解决方案

I was getting error messages because Aptana Studio (along with every other IDE) doesn't support testEqual. TestEqual only works in Active Code, the text editor that we're using (online) for the class I'm currently enrolled in. After removing:

from test import testEqual

and

testEqual(

and then printing the sum_evens function:

print(sum_evens([2,3,4]))

The console prints the correct answer without any error messages.

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

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值