Reputation: 1866
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.
Upvotes: 98
Views: 82967
Reputation: 11
Go to “File” > “Invalidate Caches / Restart” and select “Invalidate and Restart.” This will clear the cache and force PyCharm to reindex your project.
Upvotes: 1
Reputation: 521
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.
Upvotes: 24
Reputation: 1
I had a similar issue. The problem turned out to be that my PyCharm project was stored under my Mac's desktop folder. I have ICloud turned on for everything on my ~/Desktop so parts of the project weren't actually stored locally on my computer. I moved it into ~/PycharmProjects instead and now it works fine.
Upvotes: 0
Reputation: 5119
In my experience it can be any of the following problems:
Right click > Mark Directory As > Excluded
Right click > Mark Directory As > Excluded
. Or removeFile > Settings > Interpreters
File > Invalidate Cache and Restart
File > Repair IDE
.idea
folder of the project. The tip of Igor Pomaranskiy.~\.PyCharm201X
folder.Upvotes: 13
Reputation: 1
Background: I have Anaconda installed on my local computer, and PyCharm defaults to using the Anaconda environment. When I open a new project folder in PyCharm (without configuring an interpreter), PyCharm automatically creates a Python virtual environment "venv" in the project folder. However, it gets stuck at "PyCharm is scanning files to establish indices.(scanning Python SDK)"
The reason is that PyCharm's scanning includes the conda base environment, which causes the delay.Remove the paths of conda base environment and it's fine.The figures of operations is following.
Show all interpreters
Click this button:
Remove these paths:
Upvotes: 0
Reputation: 21
Don't install packages to python3 directly, globally
Consider a situation, where you have multiple projects, not all projects require library like pygame, flask...
If you open a specific project in pycharm, with python 3.x as interpreter, it will index all its modules.
So uninstall all preinstalled modules
You will be left over with wheel, pip, and the default ones
Now configure a VirtualEnvironment for each of your projects, as a local interpreter in PyCharm, and install only necessary modules.
I just did uninstall everything and reinstall inside small private venv's. For windows:
pip uninstall > requirements.txt
pip uninstall -r requirements.txt -y
(-y makes yes to all the questions - if it should start deleting)
Upvotes: 2
Reputation: 7385
The following steps helped me in Rider IDE:
1) delete .idea
folder.
2) Go to File > Settings > Python
Interpreter Node
3) From the dropdown next to Python Interpreter
label choose Show All
4) In the python Interpreters
window click Show Interpreters paths
:
5) If C:\
is present in the list of paths, it must be deleted by clicking the minus button above. Because I guess it is scanned every time which takes infinity.
Upvotes: 3
Reputation: 21
File -> Setting... -> tools -> Shared Indexes -> Python Packages
choose the option that says: "Don't download, use local indexes"
Apply good luck !
Upvotes: 2
Reputation: 812
In my case, I tried every solution that are mentioned above or anything in the internet.
Lastly, I check environment variables and I removed old entries related with python.
Then it stopped indexing.
Upvotes: 0
Reputation: 541
PyCharm will index every file unless told otherwise. The previous answers show you how to exclude a folder.
But if there are certain file types that you never need to index, such as log files, data files, compressed files, etc. (but for some reason happen to appear in your project), you can instruct PyCharm to ignore specific file extensions. Just append those file extensions to the list
Preferences > Editor > File Types > Ignore Files and Folders
Use a semicolon to separate the entries.
Note that this is a global Ignore list; there doesn't seem to be a way to exclude extensions by project.
One way to discover which file types may be causing indexing to bog down is to identify the largest files in your codebase.
Upvotes: 2
Reputation: 374
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!
Upvotes: 0
Reputation: 4164
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.
Upvotes: 98
Reputation: 5641
Maybe there are some issues in project files? Try to remove .idea
folder inside your project (but this will also purge all project settings).
Upvotes: 11