How do I handle an UnresolvedImport Eclipse (Python)

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

    import MySQLdb
    

    If this code show error like this:

    Unresolved import: MySQLdb

    you should add D:\Python27\Lib\site-packages\MySQLdb to your sys.path.

    D:\Python27\Lib\site-packages\MySQLdb is this location where you install MySQLdb in your computer disk. After this step, the error will disappear.

提交回复
热议问题