Python 2.7 importing pyc files without py files

Emile van Sebille emile at
Wed Feb 19 23:25:41 CET 2014

On 2/19/2014 2:03 PM, Mircescu Andrei wrote:

 > If there are only pyc files, the loading time of the application is
 > much more than if I have pyc and py files. It is behind with 2
 > minutes more than if it had py files

You may get some clues by starting python as

/path/to/python/python2.7 -vv

which will provide the details of attempts to import:

[root at vsds4 log]# python2.7 -vv
# installing zipimport hook
import zipimport # builtin
# installed zipimport hook
# trying /usr/local/lib/python2.7/
# trying /usr/local/lib/python2.7/
# trying /usr/local/lib/python2.7/
# /usr/local/lib/python2.7/site.pyc matches /usr/local/lib/python2.7/
import site # precompiled from /usr/local/lib/python2.7/site.pyc
# trying /usr/local/lib/python2.7/
# trying /usr/local/lib/python2.7/
# trying /usr/local/lib/python2.7/
# /usr/local/lib/python2.7/os.pyc matches /usr/local/lib/python2.7/
import os # precompiled from /usr/local/lib/python2.7/os.pyc



More information about the Python-list mailing list