15

Why is Pydev giving me syntax errors for built-in python functions like str()?

Undefined variable: str

Undefined variable: False

Undefined variable: float

9
  • code? does python even need you to id if its a str or float? Nov 11, 2011 at 20:13
  • print(str("hi")) will give a syntax error on str. Nov 11, 2011 at 20:15
  • 1
    I do not get any error for that. maybe you have a problem with Pydev configuration?
    – joaquin
    Nov 11, 2011 at 20:58
  • 5
    Your python interpreter was not configured properly
    – pylover
    Nov 11, 2011 at 21:02
  • 1
    @pylover Any idea what could not be configured properly within the interpreter? Nov 11, 2011 at 22:57

3 Answers 3

20

Remove and re-add the python interpreter in the PyDev configuration. Make sure that the project is using the newly added interpreter.

2
  • 1
    This had no effect on freshly installed Aptana 3.6 PyDev running OS X 10.11 . I am still getting "Undefined variable: None". I had not choice but to revert to Aptana 3.4. Feb 24, 2016 at 0:10
  • I tried that, it did not fix the problem using python 3.4 in an anaconda environment.
    – Soerendip
    Jul 6, 2016 at 15:51
3

This means that there's a problem with starting the shell to get completions for builtins (usually a firewall or a misconfiguration in the network -- see: http://pydev.org/faq.html#PyDevFAQ-WhenIdoacodecompletion%2CPyDevhangs%2CwhatcanIdo%3F which may give you hints on how to solve it).

Also, please add details on your error log if you're unable to solve it (see: http://pydev.org/faq.html#how_do_i_report_a_bug for details on getting the error log).

2
  • That's interesting, but I don't have a problem with the hanging completions. It's more a matter of built-ins not being recognized. This is a difficult one to reproduce, but if it happens again I will report the bug. Nov 14, 2011 at 22:45
  • @Fabio I've had both, and actually your first link led me to the solution.
    – tishma
    Mar 25, 2013 at 17:32
0

For those ppl who are using Aptana and have the same Problem:

I upgraded Aptana and PyDev with the following instructions:

Update PyDev on Aptana

after the upgrade PyDev worked just fine for me :)

1
  • Whilst this may theoretically answer the question, it would be preferable to include the essential parts of the answer here, and provide the link for reference.
    – Yurii
    Mar 30, 2015 at 13:20

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.