试图学习cx-freeze。我有一个python程序,我试图冻结exe。Python,PySerial和cx-freeze
我使用PySerial,无论我如何尝试包含win32似乎没有任何帮助。我使用Python 3.2和win7。
我已经搜索了网页薄,和其他人有同样的问题,但似乎没有解决方案出现。但我怀疑没有人成功地使用PySerial的cx_freezing。
我完全卡住了。任何帮助,将不胜感激
错误:
Traceback (most recent call last):
File "C:\Python32\lib\site-packages\
7, in <module>
exec(code, m.__dict__)
File "snapper.py", line 8, in
File "C:\Python32\lib\site-packages\
from serial.serialwin32 import *
File "C:\Python32\lib\site-packages\
e>
from serial import win32
ImportError: cannot import name win32
Setup.py:
from cx_Freeze import setup,Executable
includefiles = ['caml.pkl', 'seql.pkl']
includes = ['DataBase', 'serial.win32']
excludes = ['Tkinter']
packages = []
setup(
name = 'Setup',
version = '0.1',
description = 'Snapper configuration utility',
author = 'LST',
author_email = '[email protected]',
options = {'build_exe': {'excludes':excludes,'packages':packages,'include_files':includefiles}},
executables = [Executable('snapper.py')]
)
任何想法,以何去何从? 在此先感谢
我试图做一个盲目进口:
if False:
import serial.win32
没有运气...
也许我在看这个错误的方式....
如果将include改为'serial'会怎么样? – Velociraptors 2012-01-03 21:57:15
不,试过.. – Esben 2012-01-03 22:12:19