[Python-Dev] Embedded python on Win2K, import failures

M.-A. Lemburg mal@lemburg.com
Sat, 12 Apr 2003 12:58:33 +0200


Mark Hammond wrote:
> [Harri]
> 
>>Hello,
>>
>>In a few hours old CVS checkout, I'm having problems getting the
>>embedded python to work.
> 
> 
> This is true even in non-embedded Python.  Move away "_sre.pyd", and the
> interactive session shows:
> 
> 'import site' failed; use -v for traceback
> 
>>>>import re
>>>>dir(re)
> 
> ['__builtins__', '__doc__', '__file__', '__name__', 'engine']
> 
> Running with "-v" shows:
> 
> 'import site' failed; traceback:
> Traceback (most recent call last):
>   File "E:\src\python-cvs\lib\site.py", line 298, in ?
>     encodings._cache[enc] = encodings._unknown
> AttributeError: 'module' object has no attribute '_unknown'

This looks like a modified site.py. Where did you get this from ?

BTW, hacking encodings._cache is generally a *bad* idea. There's
no guarantee that such code will continue to work in future
releases since you are touching undocumented internals there.

-- 
Marc-Andre Lemburg
eGenix.com

Professional Python Software directly from the Source  (#1, Apr 12 2003)
 >>> Python/Zope Products & Consulting ...         http://www.egenix.com/
 >>> mxODBC, mxDateTime, mxTextTools ...        http://python.egenix.com/
________________________________________________________________________
EuroPython 2003, Charleroi, Belgium:                        73 days left