PyCharm 3.1在索引过程中永久挂起,不可用 [英] PyCharm 3.1 hangs forever during indexing and unusable

查看:222
本文介绍了PyCharm 3.1在索引过程中永久挂起,不可用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

更新到3.1之后,PyCharm在包的索引过程中永远挂起(在OSX 10.9.1,Python 2.7.5上)。

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

而索引 scipy (0.13.3)。如果我结束 scipy ,索引似乎完成,但是再次挂起在pythonstubs。

For me this occurs while indexing scipy (0.13.3). If I unistall scipy, indexing appears to complete, but then hangs again on "pythonstubs". The UI becomes unresponsive, CPU use is maxed, and I'm unable to do anything and have to force-quit the app.

如果我重新安装scipy,PyCharm会再次挂起在scipy扫描的同一位置(参见对话框的屏幕截图):

If I reinstall scipy, PyCharm hangs again at the same spot in the scipy scan (see screen capture of dialog):

FWIW,我可以从系统命令行运行Python脚本(包括使用 scipy 和许多其他最近更新或安装的软件包)没有问题,所以Python安装是正确的。

FWIW, I can run Python scripts from the system command line (including some that use scipy and many other packages recently updated or installed) without issue, so the Python installation is sound.

有任何人有类似的问题,方法围绕这一个?

Has anyone had a similar problem or found a way around this one?

推荐答案

问题在于任何正则表达式匹配可能已被定义识别TODO项目。 PyCharm用来匹配这些项的Java标准正则表达式库使用指数复杂度的算法来搜索'*。a'和类似的模式。

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.


理论上,可以匹配任何regexp非常快(一个线性算法存在),但是许多开发者的regexp libs只是'

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.

Python re模块存在相同的问题:

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

一般来说,如果索引需要很长时间或挂起,请查看TODO项目中的RegEx,看看是否可以缩小匹配范围,以便提高性能。

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.

这篇关于PyCharm 3.1在索引过程中永久挂起,不可用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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