I'm trying to compile some script with twisted and Queue.
pyinstaller sample.py --onefile
# -*- coding: utf-8 -*-#
from twisted import *
import queue as Queue
a = Queue.Queue()
Unfortunately, produced file fails with ImportError: No module named queue
.
I don't think this is a PyInstaller or Twisted related issue at all. The Queue
module is part of the standard library, and the issue is how you're naming it. In Python 2, it's Queue
with a capital letter, but in Python 3, it's renamed queue
to follow the more standard naming convention where modules have lowercase names.
Your script seems like it's a port of Python 2 code to Python 3 (thus the as Queue
part of the import
), but you're running it with Python 2 still. That may fail in other more subtle ways than just the Queue
import being wrong (e.g. its Unicode handling may be all wrong).
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With