The .pyc
files are created when files are imported. Usually running a script by itself will not create a compiled file. For instance:
% cat tmp.py
print 'in tmp.py'
When I run the file normally:
% python tmp.py
in tmp.py
there is no .pyc
file created:
% ls tmp.py*
tmp.py
However, if I import tmp
from a live Python interpreter:
% python
Python 2.7.6 (default, Nov 14 2013, 09:55:56)
[GCC 4.2.1 Compatible Apple LLVM 5.0 (clang-500.2.79)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import tmp
in tmp.py
>>>
then the compiled file is created:
% ls tmp.py*
tmp.py tmp.pyc
So, it may be normal behaviour depending on how you are running your script.
python -mcompileall