Python PyCharm 4.0.5 挂起“将文件扫描到索引”后台任务
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/29030682/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
PyCharm 4.0.5 hangs on 'scanning files to index' background task
提问by Hacking Node
My specs:
我的规格:
Intel Core i5-3470 3,2 GHz / 4 GB Ram /
I'm using Windows 64 bit. PyCharm 4.0.5
我正在使用 Windows 64 位。PyCharm 4.0.5
When I launch PyCharm it starts scanning files to indexbackground task and hangs for ~1 hour/forever. From time to time it finishes and proceeds with updating indices task. It lasts for ~3 hours/forever. While these processes are running it is very hard to use PyCharm and even some other programs. PyCharm starts from ~200MB and took ~1GB of memory at the end of these tasks.
当我启动 PyCharm 时,它开始扫描文件以索引后台任务并挂起约 1 小时/永远。它不时完成并继续更新索引任务。它持续约 3 小时/永远。当这些进程正在运行时,很难使用 PyCharm 甚至其他一些程序。PyCharm 从约 200MB 开始,在这些任务结束时占用了约 1GB 的内存。
On my laptop, which is much worse. PyCharm launches in 30 seconds and ready to work. I'm working on the same project on my PC/Laptop
在我的笔记本电脑上,情况要糟糕得多。PyCharm 在 30 秒内启动并准备工作。我正在我的 PC/笔记本电脑上处理同一个项目
Please, advise.
请指教。
P.S I don't have symlinks to exclude in my Project Structure.
PS 我的项目结构中没有要排除的符号链接。
回答by W.P. McNeill
Deleting and reinstalling Pycharm 4.0.5 fixed this for me.
删除并重新安装 Pycharm 4.0.5 为我解决了这个问题。
回答by Choi
I just tried the following:
我只是尝试了以下方法:
In PyCharm, go to the "File" on the left top, then select "invalidate caches/restart...", and press "Invalidate and restart".
在 PyCharm 中,转到左上角的“文件”,然后选择“使缓存无效/重新启动...”,然后按“无效并重新启动”。
After that, it can finish scanning in a short period without hanging anymore.
之后,它可以在短时间内完成扫描而不再挂起。
回答by Jaanus
My project contained a folder that had like 100k files/folders inside. This was making indexing way too slow.
我的项目包含一个文件夹,里面有 10 万个文件/文件夹。这使得索引太慢了。
To fix this, exclude the folder from Project structure in PyCharm.
要解决此问题,请从 PyCharm 的项目结构中排除该文件夹。
File - Settings - Project: yourprojectname - Project Structure - Right click on folder and press "Excluded"
回答by Елизавета Шульга
I've already answered this question on Stackoverflow, so I'll just copy and paste... 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 its removal Pycharm launched as if you've just downloaded it, everything still goes well.
我已经在 Stackoverflow 上回答了这个问题,所以我只是复制和粘贴......我遇到了同样的问题,“文件|无效缓存/重启”没有帮助,因为 Pycharm 根本没有响应。我在我的主目录中找到了“.Pycharm50”目录——它包含配置文件。删除 Pycharm 后,就像您刚刚下载它一样启动,一切仍然顺利。
回答by BrokenRobot
I ended up going to the .ideafolder of the project and deleting it in order to keep it from hanging when it starts. Then made any appropriate changes to keep it from indexing unnecessary files.
我最终转到 项目的.idea文件夹并将其删除,以防止它在启动时挂起。然后进行任何适当的更改以防止它索引不必要的文件。
回答by Lucas Vanhalst
Late answer but this may help other people in the future. For me this issue was fixed by raising the inotify watches limit. After raising it as described on jetbrains their website (https://confluence.jetbrains.com/display/IDEADEV/Inotify+Watches+Limit) it worked properly.
迟到的答案,但这可能会在未来帮助其他人。对我来说,这个问题是通过提高 inotify 手表限制来解决的。按照 jetbrains 的网站(https://confluence.jetbrains.com/display/IDEADEV/Inotify+Watches+Limit)上的描述将其提升后,它可以正常工作。
- Add the following line to either /etc/sysctl.conf file or a new *.conf file (e.g. idea.conf) under /etc/sysctl.d/ directory:
fs.inotify.max_user_watches = 524288
- Then run this command to apply the change:
sudo sysctl -p --system
- 将以下行添加到 /etc/sysctl.conf 文件或 /etc/sysctl.d/ 目录下的新 *.conf 文件(例如 idea.conf):
fs.inotify.max_user_watches = 524288
- 然后运行此命令以应用更改:
sudo sysctl -p --system