pylint无法识别某些标准库 [英] pylint not recognizing some of the standard library

查看:60
本文介绍了pylint无法识别某些标准库的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在python 2.6中使用pylint + pydev.我有一个只有这行代码的模块

I'm using pylint + pydev, with python 2.6. I have a module with just this line of code

from email import Message

现在,当我尝试运行此模块时,它可以正常运行.但是pylint报告一个错误:

Now when I try to run this module it runs fine. But pylint reports an error:

ID: E0611 No name 'Message' in module 'email'

尽管存在...知道为什么吗?

Although it exists... Any idea why?

推荐答案

我喜欢pylint,但是我确实发现我必须使用很多#pylint:disable-msg = E0611 之类的东西在完全正确但又令人困惑的情况下将其关闭(例如,在这种情况下,由于 email 正在使用导入技巧).

I like pylint, but I do find I have to use a lot of # pylint: disable-msg=E0611 and the like to make it shut up in cases that are perfectly correct but confuse it (for example, like in this case, due to email's playing with import tricks).

这篇关于pylint无法识别某些标准库的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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