如何处理UnresolvedImport Eclipse(Python) [英] How do I handle an UnresolvedImport Eclipse (Python)

查看:341
本文介绍了如何处理UnresolvedImport Eclipse(Python)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当我在Eclipse中使用PyDev插件写入导入MySQLdb 时,我得到一个未解析的导入。但是,程序运行没有错误。我可以添加一个注释来使错误消失,但是什么是正确的方法呢?

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 the error to go away, but what is the right way to handle this?

如何帮助Eclipse了解MySQLdb是否存在?

How can I help Eclipse know that MySQLdb is there?

推荐答案

cdleary上面提供了两年前的原因,但这可能会更容易。基本上,一个重新安装解释器。

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


  1. 选择窗口 - >首选项 - > PyDev - >口译 - Python

  2. 在上部窗格中选择python解释器

  3. 点击删除

  4. 点击自动配置

  5. 同意一切。

  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.

这个工作在Fedora 17上,使用包管理附带的Eclipse 4.2.0。

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

这篇关于如何处理UnresolvedImport Eclipse(Python)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆