Issue281

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.

Messages
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 app.py

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\app.py", line 6, in <module>
  File "C:\app\app.dist\serial\__init__.py", line 26, in serial

  File "C:\app\app.dist\serial\serialwin32.py", line 12, in serialwin32
  File "C:\Python27\lib\ctypes\__init__.py", 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 serialwin32.py file or to my Python script fixes the issue.

Using Windows 7, Python 2.7.10, latest pyserial.
History
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