Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bitio has problems when bundled into a single executable using pyinstaller #22

Open
ukscone opened this issue Dec 12, 2017 · 1 comment

Comments

@ukscone
Copy link

ukscone commented Dec 12, 2017

when using pyinstaller to turn a bitio based program into a single executable with no other pyinstaller options than -F (single file) e.g.

pyinstaller -F my_script.py

pyinstaller uses the system pyserial e.g. warning:I got the system installed pyserial, that was unexpected
if pyinstaller is used with the -p option to add the abs path of the microbit module then it uses the microbit supplied serialmodule but then it fails for REPL
e.g.
Traceback (most recent call last): File "scan-n-go-ini.py", line 30, in <module> import microbit File "<frozen importlib._bootstrap>", line 2237, in _find_and_load File "<frozen importlib._bootstrap>", line 2226, in _find_and_load_unlocked File "<frozen importlib._bootstrap>", line 1200, in _load_unlocked File "<frozen importlib._bootstrap>", line 1129, in _exec File "c:\python34\lib\site-packages\PyInstaller\loader\pyimod03_importers.py", line 631, in exec_module exec(bytecode, module.__dict__) File "microbit\__init__.py", line 127, in <module> repl = repl.REPL(s) AttributeError: 'module' object has no attribute 'REPL' [5024] Failed to execute script scan-n-go-ini

@ukscone
Copy link
Author

ukscone commented Dec 13, 2017

changing the import line from
import serial

to
from . import serial

seems to fix it although probably not the "right" way to do it

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant