免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
最近访问板块 发新帖
查看: 5016 | 回复: 7
打印 上一主题 下一主题

py2exe 问题 [复制链接]

论坛徽章:
0
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2006-07-02 10:22 |只看该作者 |倒序浏览
使用python2.4 py2exe 0.6.5
\site-packages\pymssql.py 需要 ntwdblib.dll

setup.py

  1. from distutils.core import setup
  2. import py2exe
  3. import sys
  4. if len(sys.argv) == 1:
  5.     sys.argv.append("py2exe")
  6.     sys.argv.append("-q")

  7. setup(options = {"py2exe": {
  8.                            "compressed": 1,
  9.                           "optimize": 2}},
  10.       console=["DB.py"])
复制代码

运行 python setup.py
running py2exe
*** searching for required modules ***
*** parsing results ***
*** finding dlls needed ***
*** create binaries ***
*** byte compile python files ***
E:\Python24\python.exe -OO e:\docume~1\admini~1\locals~1\temp\tmptnvdaw.py
removing e:\docume~1\admini~1\locals~1\temp\tmptnvdaw.py
*** copy extensions ***
*** copy dlls ***
copying E:\Python24\Lib\site-packages\py2exe\run.exe -> C:\netgame\src\dist\DB.exe
Adding zlib.pyd to C:\netgame\src\dist\library.zip

*** binary dependencies ***
Your executable(s) also depend on these dlls which are not included,
you may or may not need to distribute them.

Make sure you have the license if you distribute any of them, and
make sure you don't distribute files belonging to the operating system.

   USER32.dll - E:\WINDOWS\system32\USER32.dll
   ADVAPI32.dll - E:\WINDOWS\system32\ADVAPI32.dll
   KERNEL32.dll - E:\WINDOWS\system32\KERNEL32.dll
   ntwdblib.dll - E:\Python24\Lib\site-packages\ntwdblib.dll
   SHELL32.dll - E:\WINDOWS\system32\SHELL32.dll


然后运行DB.EXE
Traceback (most recent call last):
  File "DB.py", line 1, in ?
  File "pymssql.pyo", line 24, in ?
ImportError: No module named decimal

这是啥问题?在SHELL里运行OK的

论坛徽章:
0
2 [报告]
发表于 2006-07-03 11:49 |只看该作者
试试pyinstaller

论坛徽章:
0
3 [报告]
发表于 2006-07-04 09:59 |只看该作者
你的DB.py是GUI程序吗?

论坛徽章:
0
4 [报告]
发表于 2006-07-05 16:10 |只看该作者
DB.py不是窗口程序,只是通过DB调用pymssql

论坛徽章:
0
5 [报告]
发表于 2006-07-05 17:00 |只看该作者
试试在你的DB.py里
import  decimal

http://mail.python.org/pipermail ... October/305596.html

论坛徽章:
0
6 [报告]
发表于 2006-07-10 12:05 |只看该作者
可以了,谢谢

论坛徽章:
0
7 [报告]
发表于 2008-05-04 12:37 |只看该作者
但是生成的exe表格无法生成中文字段 在shell没有问题

论坛徽章:
0
8 [报告]
发表于 2008-09-02 11:53 |只看该作者
恩,很好。很不错。今天就碰到了这个问题
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年举报专区
中国互联网协会会员  联系我们:huangweiwei@itpub.net
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP