Title Import serial breaks standalone build
Priority bug Status resolved
Superseder Nosy List Sam
Assigned To Keywords

Created on 2016-01-11.00:23:14 by Sam, last changed by kayhayen.

msg2248 (view) Author: kayhayen Date: 2017-10-17.13:31:55
The ctypes issue is fixed with the last release I just made. Seems those 
extension modules from standard library were not included.
msg1957 (view) Author: oyster Date: 2016-08-31.11:42:36
pyqt4 and pyside also breaks standalone build on win7 too. This can be fixed by
adding "import _ctypes" in my source code
msg1768 (view) Author: Sam Date: 2016-01-11.00:52:24
Note that the workaround results in a _ctypes.pyd file being created (which 
clearly fixes the import error).
msg1767 (view) Author: Sam Date: 2016-01-11.00:23:14
I'm attempting to build a very simple Python standalone executable using Nuitka:

import serial
print 'hello'

Building the executable using

nuitka --standalone --portable

works, but if the PC's C:\Python27 directory is missing then the program fails with:

Traceback (most recent call last):
  File "C:\app\app.dist\", line 6, in <module>
  File "C:\app\app.dist\serial\", line 26, in serial

  File "C:\app\app.dist\serial\", line 12, in serialwin32
  File "C:\Python27\lib\ctypes\", line 10, in <module>

ImportError: No module named _ctypes

I've found a workaround of adding 

import _ctypes

to the top of the serial module's file or to my Python script fixes the issue.

Using Windows 7, Python 2.7.10, latest pyserial.
Date User Action Args
2017-10-17 13:31:55kayhayensetstatus: chatting -> resolved
messages: + msg2248
2016-08-31 11:42:36oystersetmessages: + msg1957
2016-01-11 00:52:24Samsetstatus: unread -> chatting
messages: + msg1768
2016-01-11 00:23:14Samcreate