Python Pycharm 5.0.1:永远扫描文件到索引
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/34976058/
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 5.0.1: Scanning files to index taking forever
提问by sP_
I am using PyCharm Community Edition 5.0.1 It was working fine till yesterday. But it has been stuck at 'Scanning files to index' for a very long time now. Since yesterday.
我正在使用 PyCharm 社区版 5.0.1 直到昨天它都运行良好。但是很长一段时间以来,它一直停留在“扫描文件以建立索引”。从昨天开始。
I have tried re-installing it, and also tried invalidating cache.
我试过重新安装它,也试过使缓存无效。
I can make changes to programs and use it as a text editor but unable to run any file. Can anyone help? Thanks.
我可以更改程序并将其用作文本编辑器,但无法运行任何文件。任何人都可以帮忙吗?谢谢。
采纳答案by www.data-blogger.com
Exclude the folders you do not want to index. You can do this by right-clicking the folder you want to exclude, then choose Mark Directory As > Excluded
and PyCharm will not index those files.
排除您不想索引的文件夹。您可以通过右键单击要排除的文件夹来执行此操作,然后选择Mark Directory As > Excluded
,PyCharm 将不会索引这些文件。
回答by Igor Pomaranskiy
Maybe there are some issues in project files? Try to remove .idea
folder inside your project (but this will also purge all project settings).
也许项目文件中存在一些问题?尝试删除.idea
项目中的文件夹(但这也会清除所有项目设置)。
回答by Roelant
In my experience it can be any of the following problems:
根据我的经验,它可能是以下任何问题:
- You added a new folder to your project which includes many files. Then follow the tip from sP_ and use
Right click > Mark Directory As > Excluded
- You just had this problem for the first time. Use
File > Invalidate Cache and Restart
- It happens on a specific project. If you're willing to give up all your project settings, delete the
.idea
folder of the project. The tip of Igor Pomaranskiy. - If you are working on linux you could check this answerin a similar question.
- It keeps happening. If you're willing to give up all your settings, delete the
~\.PyCharm201X
folder.
- 您向项目添加了一个新文件夹,其中包含许多文件。然后按照 sP_ 的提示操作并使用
Right click > Mark Directory As > Excluded
- 你只是第一次遇到这个问题。用
File > Invalidate Cache and Restart
- 它发生在特定项目上。如果您愿意放弃所有项目设置,请删除
.idea
项目文件夹。Igor Pomaranskiy 的提示。 - 如果您在 linux 上工作,则可以在类似问题中查看此答案。
- 它一直在发生。如果您愿意放弃所有设置,请删除该
~\.PyCharm201X
文件夹。
回答by Yishai E
In some cases, this is because Pycharm scans and indexes the PYTHONPATH. I figured out that some shared script I was running got changed by some nincompoop (may his severed head soon decorate our moat) and the /homes directory got into the PYTHONPATH.
在某些情况下,这是因为 Pycharm 会扫描并索引 PYTHONPATH。我发现我正在运行的一些共享脚本被一些 nincompoop 改变了(可能他的头颅很快就会装饰我们的护城河),并且 /homes 目录进入了 PYTHONPATH。
How to get it out: Go to File->Settings->Project:[your project]->Project Interpreter
如何获取:转到File->Settings->Project:[your project]->Project Interpreter
On the right hand side you'll see a cogwheel, click it, then select Show all...
在右侧,您将看到一个齿轮,单击它,然后选择全部显示...
In the next window, your environment will be selected. There are a few icons on the right hand side of this window, one of them is a directory tree. Click it.
在下一个窗口中,将选择您的环境。此窗口的右侧有几个图标,其中之一是目录树。点击它。
You'll find a list of all interpreter paths. Remove the directory that is causing your problem, dance a little victory dance, and resume work.
您将找到所有解释器路径的列表。删除导致问题的目录,跳一小段胜利之舞,然后继续工作。
回答by kusiroll
Try to make sure you have no compressed files in your directory, as removing this might show significant improvement in speed. it worked for me!
尽量确保您的目录中没有压缩文件,因为删除它可能会显着提高速度。它对我有用!