PyCharm 3.1 hangs forever during indexing and unusable

前端 未结 4 2282
伪装坚强ぢ
伪装坚强ぢ 2021-02-14 01:25

After updating to 3.1, PyCharm hangs forever (on OSX 10.9.1, Python 2.7.5) during the \"indexing\" of packages.

For me this occurs while indexing scipy (0.1

相关标签:
4条回答
  • 2021-02-14 01:46

    I had a similar situation: I just installed Anaconda(2) and when I wanted to change interpreters it will keep indexing and crash. "Invalidate Cache" would not work. What need to be done is to add the interpreter (Project -> Project Interpreter) AND change the Run -> Edit Configurations. I got the reponse from here

    0 讨论(0)
  • 2021-02-14 01:50

    I had the same problem and "File | Invalidate Caches/Restart" had not helped because Pycharm didn't respond at all. I found ".Pycharm50" directory in my home directory -- it contains configuration files. After it's removal Pycharm launched as if you've just downloaded it, everything still goes well.

    0 讨论(0)
  • 2021-02-14 02:05

    This is what solved it for me:

    On the main menu, choose File | Invalidate Caches/Restart . The Invalidate Caches message appears informing you that the caches will be invalidated and rebuilt on the next startup. Use buttons in the dialog to invalidate caches, restart IntelliJ IDEA or both.

    My problem was probably that I added too many files to be indexes, and it overwhelmed PyCharm. So I marked the folders of the files I did not need indexed as "Excluded" and used the option above.

    0 讨论(0)
  • 2021-02-14 02:06

    The problem lies with any regular expression matches that may have been defined to identify TODO items. The Java standard regular expression library used by PyCharm to match these items uses an algorithm of exponential complexity to search for '*.a' and similar patterns.

    Theoretically, it is possible to match any regexp very fast (a linear algorithm exists), > but many developers of regexp libs simply don't bother implementing it.

    The same problem exists for the Python re module:

    >>> from timeit import timeit
    >>> timeit("import re; list(re.finditer('.*a', 'foo' * 10000))", number=1)
    0.6927990913391113
    >>> timeit("import re; list(re.finditer('.*a', 'foo' * 50000))", number=1)
    17.076900005340576
    

    In general, if indexing is taking a long time, or hanging, look to the RegEx in your TODO items and see if you can narrow the scope of matches in order to improve performance.

    0 讨论(0)
提交回复
热议问题