ASPN ActiveState Programmer Network
ActiveState
/ Home / Perl / PHP / Python / Tcl / XSLT /
/ Safari / My ASPN /
Cookbooks | Documentation | Mailing Lists | Modules | News Feeds | Products | User Groups


Recent Messages
List Archives
About the List
List Leaders
Subscription Options

View Subscriptions
Help

View by Topic
ActiveState
.NET Framework
Open Source
Perl
PHP
Python
Tcl
Web Services
XML & XSLT

View by Category
Database
General
SOAP
System Administration
Tools
User Interfaces
Web Programming
XML Programming


MyASPN >> Mail Archive >> py2exe-users
py2exe-users
Re: [Py2exe-users] ImportError: No module named encodings
by Werner F. Bruhin other posts by this author
Nov 23 2006 5:30AM messages near this date
[Py2exe-users] ImportError: No module named encodings | [Py2exe-users] py2exe bundles and win32com.mapi.mapi
Hi,

PÄ?teris BrÅ«ns wrote:
>  Hello!
>  
>  I have problem with py2exe.
>  I have python (python 2.4.3) application with wxWidgets (2.6.3) and i 
>  use PostgreSQL database with PostgresPy on WinXP 64
>  My database and application use UTF-8. If i run application all is 
>  working. If i try to make exe with py2exe it makes it but is problems 
>  when i try to execute my exe:
>  
>  -with PostgreSQL, PostgresPy i have only error:
>  
>  Traceback (most recent call last):
>    File "App1.py", line 6, in ?
>    File "zipextimporter.pyo", line 78, in load_module
>    File "Frame1.pyo", line 4, in ?
>    File "zipextimporter.pyo ", line 78, in load_module
>    File "pg2.pyo", line 2, in ?
>    File "zipextimporter.pyo", line 78, in load_module
>    File "postgresql\__init__.pyo", line 6, in ?
>  ImportError: No module named encodings
>  
>  -without PostgreSQL, PostgresPy exe is running without error.
>  
>  How to fix this problem?!
You need to tell py2exe to include the package encodings, look at the 
packages instruction below.

Part of my setup.py looks like this:
# options for py2exe
options = {"py2exe": {"compressed": 1,
                       "optimize": 2,
                       "packages": ["encodings",
                                    "kinterbasdb",
                                    "pytz.zoneinfo.UTC", 
"matplotlib.numerix",
##                                   "numpy"
##                                   "PIL",
                                    ],
                       "excludes": ["MySQLdb", "Tkconstants", "Tkinter", 
"tcl",
                                    "orm.adapters.pgsql", 
"orm.adapters.mysql"
                       ],
                       "dll_excludes": ["tcl84.dll", "tk84.dll", 
"wxmsw26uh_vc.dll"]
                       }
           }

Hope this helps
Werner


-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys - and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
Py2exe-users mailing list
Py2exe-users@[...].net
https://lists.sourceforge.net/lists/listinfo/py2exe-users
Thread:
Peteris Bruns
Werner F. Bruhin

Privacy Policy | Email Opt-out | Feedback | Syndication
© 2004 ActiveState, a division of Sophos All rights reserved