How do I handle an UnresolvedImport Eclipse (Python)

后端 未结 8 2467
悲&欢浪女
悲&欢浪女 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:24

    Adding the egg works, but the error remains. The solution for that error can be found by adding

    #@UnresolvedImport
    

    To the import statement, as in:

    import web #@UnresolvedImport
    

    Source: http://klaith.wordpress.com/2009/06/12/pydev-unresolved-import-errors/

提交回复
热议问题