Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Pycharm: "scanning files to index" is taking forever

Tags:

python

pycharm

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.

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.

like image 881
sP_ Avatar asked Jan 24 '16 12:01

sP_


People also ask

What does it mean when PyCharm is indexing?

Indexing examines the code of your project to create a virtual map of classes, methods, objects, and other code elements that make up your application. This is necessary to provide the coding assistance functionality, search, and navigation instantaneously. After indexing, the IDE is aware of your code.


2 Answers

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.

like image 66
www.data-blogger.com Avatar answered Oct 18 '22 09:10

www.data-blogger.com


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.

How to get it out: Go to 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.

like image 45
Yishai E Avatar answered Oct 18 '22 08:10

Yishai E