How do I handle an UnresolvedImport Eclipse (Python)

后端 未结 8 2416
悲&欢浪女
悲&欢浪女 2021-02-20 04:41

When I write import MySQLdb in Eclipse using the PyDev plugin, I get an unresolved import. However, the program runs without error. I can add an annotation to get

8条回答
  •  我在风中等你
    2021-02-20 05:35

    cdleary above provided the reason two years ago, but this may be easier. Basically, one reinstalls the interpreter.

    1. Select Window - > Preferences -> PyDev -> Interpreter - Python
    2. Select the python interpreter in the upper pane
    3. Click on Remove
    4. Click on Auto Config
    5. Agree to everything.

    This works on Fedora 17 using the Eclipse 4.2.0 that came with the package management.

提交回复
热议问题