1

I'm using the Redhawk IDE. I noticed when I write Python in the IDE, none of the built-ins (len(),str(),True,False,etc...) are recognized, which gives errors and causes them to be underlined in red.

However, if I install to Target SDR anyway, the component seems to function normally.

How can I get Python in the IDE to recognize built-ins so I can get rid of the faulty errors?

2 Answers2

2

Erik's answer led to the solution. What worked for me is:

  1. Window -> Preferences
  2. PyDev -> Interpreter - Python
  3. Remove Python interpreter
  4. Click "New..."
  5. Enter interpreter name ("Python" works) and select path to interpreter
  6. By default, the top option was selected. Make sure it isn't: add org.python.pydev to the system path
  7. Click "OK"
  8. Click "Apply"

You should now see that the built-in functions are recognized by Python.

1

If you can't run any Python in the IDE, there are two possible explanations:

1. You have an incorrect Python path being set for you by Eclipse, and you will have to adjust it manually. Using this article from Opal, you can easily check that Python is in fact correctly linking to your IDE, and if it isn't you can point it in the right direction.

2. You have a broken installation of Redhawk. Sounds dubious but you can always try a fresh install.

HavelTheGreat
  • 3,299
  • 2
  • 15
  • 34
  • I just tried the checks here, and it seems like everything is set up fine. When I click Build in Redhawk, I can see the Python interpreter return errors, which tells me that Python is finding it correctly. But for whatever reason, it seems like Python does not have access to the built-in functions. Is there a way to check in Redhawk/Eclipse that the Python standard built-ins are correctly linked to Python? – five_dollar_shake Feb 19 '15 at 16:24
  • I may have to just reinstall Redhawk, I'll let you know if it comes to that. – five_dollar_shake Feb 19 '15 at 16:24
  • I may be mistaken but I don't believe so. My apologies for not being of greater assistance. – HavelTheGreat Feb 19 '15 at 16:26
  • 3
    Sounds like a problem with the PyDev interpreter try taking a look at this: http://stackoverflow.com/questions/8099380/why-is-pydev-giving-a-syntax-error-for-built-in-keywords – Erik Englund Feb 19 '15 at 19:50