推荐学习书目
› Learn Python the Hard Way
Python Sites
› PyPI - Python Package Index
› http://diveintopython.org/toc/index.html
› Pocoo
值得关注的项目
› PyPy
› Celery
› Jinja2
› Read the Docs
› gevent
› pyenv
› virtualenv
› Stackless Python
› Beautiful Soup
› 结巴中文分词
› Green Unicorn
› Sentry
› Shovel
› Pyflakes
› pytest
Python 编程
› pep8 Checker
Styles
› PEP 8
› Google Python Style Guide
› Code Style from The Hitchhiker's Guide
davepkxxx
V2EX  ›  Python

PyCharm 提示 Unresolved reference 求助

  •  
  •   davepkxxx ·
    davepkxxx · Sep 22, 2013 · 53708 views
    This topic created in 4789 days ago, the information mentioned may be changed or developed.
    买了 PyCharm 之后一直在做 Console 程序,最近想用 PyQt 开发一些桌面应用。但是引用 PyQt 的时候发现 PyCharm 提示了一个奇怪的错误,内容如下:

    Unresolved reference 'QProgressBar' less... (Ctrl+F1)
    This inspection detects names that should resolve but don't. Due to dynamic dispatch and duck typing, this is possible in a limited but useful number of cases. Top-level and class-level items are supported better than instance items.



    请问如何解决这个问题?
    Supplement 1  ·  Sep 22, 2013
    py 文件可以运行,无 Bug,只是 PyCharm 有这个提示。
    13 replies  •  1970-01-01 08:00:00 +08:00
    clouder
    clouder
    Sep 22, 2013
    1
    可以看看是不是没有这个模块,或者名字没写对。
    davepkxxx
    davepkxxx
    OP
    Sep 22, 2013
    2
    @clouder py 文件可以运行,无 Bug,只是 PyCharm 有这个提示。
    clouder
    clouder
    Sep 22, 2013
    3
    程序里有用到这个模块呗吗?
    CoX
    CoX
    Sep 22, 2013
    4
    把 import 后面的括号()去掉就不提示这个错误了
    davepkxxx
    davepkxxx
    OP
    Sep 22, 2013
    5
    @CoX 去掉了括号依然有提示这个错误,并且不能换行写了。
    robinlovemaggie
    robinlovemaggie
    Sep 22, 2013
    6
    这个貌似是缺包导致的,同时你程序里面肯定没用到这个QProgressBar
    ipconfiger
    ipconfiger
    Sep 22, 2013
    7
    左边

    这里加入要引用的包地址
    davepkxxx
    davepkxxx
    OP
    Sep 22, 2013
    8

    之前就已经加入了 Qt5 的包
    davepkxxx
    davepkxxx
    OP
    Sep 22, 2013
    9
    timonwong
    timonwong
    Sep 22, 2013
    10
    老问题了,看看这里的Workaround:
    http://youtrack.jetbrains.com/issue/PY-5131?query=%22
    davepkxxx
    davepkxxx
    OP
    Sep 22, 2013
    11
    @timonwong 但是没有解决方案啊
    timonwong
    timonwong
    Sep 23, 2013 via iPhone
    12
    里面有啊,按Jonas Göransson的评论,修改generator3.py,然后按Anže Starič所说方法执行generator3就可以了
    davepkxxx
    davepkxxx
    OP
    Sep 23, 2013
    13
    @timonwong 谢谢,我今天回去试试。
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Privacy   ·   Solana   ·   4981 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 35ms · UTC 07:22 · PVG 15:22 · LAX 23:22 · JFK 02:22
    ♥ Do have faith in what you're doing.