Embedded Python application don't work if Python is installed

Miki Tebeka miki.tebeka at zoran.com
Wed Jul 7 03:04:30 EDT 2004


Hello Thomas,

> > An embedded python application is working fine on a "clean" computer.
> > When it runs on a computer with python installed (the very same computer
> > used to produce the application) it has a import error:
> > ----------
> > can't import SACD module (sacd.py)
> > Error in sys.exitfunc:
> > Traceback (most recent call last):
> >   File "atexit.pyc", line 20, in _run_exitfuncs
> >   File "threading.pyc", line 566, in __exitfunc
> >   File "threading.pyc", line 578, in _pickSomeNonDaemonThread
> >   File "c:\ADP86Tools\bin\sacd.py", line 44, in ?
> >     filterwarnings("ignore", category=FutureWarning)
> >   File "warnings.pyc", line 140, in filterwarnings
> >   File "re.pyc", line 5, in ?
> >   File "sre.pyc", line 97, in ?
> >   File "sre_compile.pyc", line 13, in ?
> >   File "_sre.pyc", line 9, in ?
> >   File "_sre.pyc", line 7, in __load
> > ImportError: DLL load failed: The specified module could not be found.
> > ----------
> > (The traceback is printed from the embedding application)
> >
> First, but maybe you have seen this already, isn't the real problem that
> SACD cannot be imported? Where is the traceback for that?
The SACD module can be imported on a machine without Python installed and
it's working.

> The traceback above imo only shows that there's a problem shutting down
> the application.  
The application is shutting down since SACD can't be imported.

> This is because the *only* item on sys.path is the library.zip file.
Nope, printing sys.path showed that all the "regular" Python path is in.

> Second, you say the problem only shows up on a computer where python is
> installed.  To track down this, you can define a PY2EXE_VERBOSE
> environment variable before running the exe - this has the same effect
> as the PYTHONVERBOSE env var, or the -v flag, for normal Python: it
> traces import statements to the console.
This is *not* a python script wrapped with py2exe. py2exe was
used only to find the dependencies and create the zip file (which was
renamed to python23.zip).

I've found out that if I remove the _sre.pyd and the zip library everything
works on a computer with Python installed. However I'm still in the dark on
how to solve this.

Thanks for your time.

Bye.
--
------------------------------------------------------------------------
Miki Tebeka <miki.tebeka at zoran.com>
http://tebeka.spymac.net
The only difference between children and adults is the price of the toys



More information about the Python-list mailing list