Skip to content

Instantly share code, notes, and snippets.

@Jhenxu
Created January 25, 2014 18:15
Show Gist options
  • Save Jhenxu/8620915 to your computer and use it in GitHub Desktop.
Save Jhenxu/8620915 to your computer and use it in GitHub Desktop.
rm all
We often get strange errors with python. When you changing the source and cannot figure out why files are used from past. So if you ever get this dejavu feeling, try using this command:
```
find . -type f -name '*.pyc' -exec rm {} \;
```
It will delete all precompiled python sources. (Because with python you have ability to distribute your files in binaries in fact.) Those errors usually appear if you move/delete *.py files with version control. You usually exclude *.pyc files from list. Old links used this way. Debugger does not suggest wrong imports because your files are in fact there, just precompiled.
Anyway I've just put this command to my blog for memorizing. It often helps me. Maybe it can for you.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment