1

I am having issues building an exe verision of my python 3.2 script. The script requires pyserial and builds using cx_freeze. However, when I run the exe I get:

Traceback (most recent call last):
File "C:\Python32\lib\site-packages\cx_Freeze\initscripts\Console3.py", line 27,
in   <module>
  exec(code, m.__dict__)
File "my_serial_program.py", line 1, in <module>
  import serial
File "C:\Python32\lib\site-packages\serial\__init__.py", line 19, in <module>
  from .serialwin32  import *
File "C:\Python32\lib\site-packages\serial\serialwin32.py", line 12, in <module>
  from . import win32
ImportError: cannot import name win32

Doing a little snooping, Pyserial site-package has a "win32.py" module (in addition to serialwin32.py); however, in the compressed lib that cx_freeze produces, win32.py is missing. Simply placing a pyc version does not fix the issue. Also using cx_freeze "includes = [ ]" does not work.

Any ideas? Is my question even cogent (I am fairly new to python)?

mudd
  • 11
  • 3

1 Answers1

0

I had the same issue. There is an option to include extra modules as mentioned in cx_Freeze ImportError: cannot import name and documentation for cx_Freeze

Just append --include-modules serial.win32

Community
  • 1
  • 1
mlt
  • 1,595
  • 2
  • 21
  • 52