PyCharm autocomplete does not work with pygame

前端 未结 3 1080
伪装坚强ぢ
伪装坚强ぢ 2021-02-09 00:20

I\'ve just installed PyCharm Community Edition 3.4.1 and tried to make a simple pygame project in it. I found that code completion runs in a weird way. In this case:

<         


        
3条回答
  •  小鲜肉
    小鲜肉 (楼主)
    2021-02-09 00:53

    It has to do with how pygame is constructed.

    The:

    python\Lib\site-packages\pygame\__init__.py
    

    File contains the following construction:

    try: import pygame.cdrom
    except (ImportError,IOError):cdrom=MissingModule("cdrom", geterror(), 1)
    

    Which allows missing imports. However, this confuses pycharm. Removing the try+except will fix the pycharm auto completion.

提交回复
热议问题