Python 2.7 importing pyc files without py files

Mircescu Andrei mircescu.andrei at gmail.com
Thu Feb 20 08:36:29 EST 2014


joi, 20 februarie 2014, 00:25:41 UTC+2, Emile van Sebille a scris:
> 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/site.so
> 
> # trying /usr/local/lib/python2.7/sitemodule.so
> 
> # trying /usr/local/lib/python2.7/site.py
> 
> # /usr/local/lib/python2.7/site.pyc matches /usr/local/lib/python2.7/site.py
> 
> import site # precompiled from /usr/local/lib/python2.7/site.pyc
> 
> # trying /usr/local/lib/python2.7/os.so
> 
> # trying /usr/local/lib/python2.7/osmodule.so
> 
> # trying /usr/local/lib/python2.7/os.py
> 
> # /usr/local/lib/python2.7/os.pyc matches /usr/local/lib/python2.7/os.py
> 
> import os # precompiled from /usr/local/lib/python2.7/os.pyc
> 
> ...
> 
> 
> 
> 
> 
> 
> 
> HTH,
> 
> 
> 
> Emile

I cannot start python since i'm embedding it in .net with pythonnet solution.







More information about the Python-list mailing list