Muhammad Adeel Zahid
Muhammad Adeel Zahid

Reputation: 17784

PyDev-Eclipse Shows Error but Code Runs Fine

I have just installed PyDev into eclipse and tried writing a hello world application. But eclipse underline even the print function and gives message of print:undefined variable on hover. But the code works fine. When I run the application it runs fine and prints Hello World on console. I am attaching the screenshot for reference enter image description here Please note that I have come across similar question and proposed solution of removing and re-adding the interpreter did not work for me. I am on Ubuntu 16.0.4 machine if that matters.
Edit
I have following entries in python interpreter's tab enter image description here

Upvotes: 0

Views: 1084

Answers (2)

tulu
tulu

Reputation: 73

I had the similar problem, so following suggestions of:
PyDev Docs

I added missing LD_LIBRARY_PATH in Window->Preferences->Python Interpreter (Environment tab), and then closed and reopened the project (no need to recreate the project). Once I reopen the files that had errors, the errors were gone.

Upvotes: 0

Muhammad Adeel Zahid
Muhammad Adeel Zahid

Reputation: 17784

The problem solved by removing all the interpreters, including them again and recreating the project. Please note that project created before removing/adding interpreters still showed error. So I removed them as well and created a new project which worked fine.

Upvotes: 1

Related Questions