- In the Project tool window, right-click a project or directory, where .pyc files should be deleted from.
- On the context menu, choose Clean .pyc.
The .pyc files that reside in the selected directory are silently deleted.
- If you rename or delete a Python file, the corresponding .pyc file is also deleted.
- .pyc files are deleted recursively.
- If you perform update from VCS and skip automatic cleanup, then removing .pyc files is vital. The reason is that after update from version control, some of the Python files could have been deleted, and executing the command will help you get rid of the unnecessary .pyc files.