Skip to content Skip to sidebar Skip to footer

Importerror: No Module Named 'queue' While Running My App Freezed With Cx_freeze

I am using python 3.4. I am able to run my python script without any problem. But While running my freezed python script , following error have appeared. I am able to freeze my sc

Solution 1:

I had the same issues running on Ubuntu with Python 3.5. It seems that cx_freeze has problems with libraries that import other files or something like that.

Importing Queue together with requests worked for me, so:

import requests
from multiprocessing importQueue

And I don't think specifying urllib in "packages": ["urllib", "requests"] is necessary.

Solution 2:

There are Several options based on project packages:

Method1:

Answer: I solve the problem my issue was I had file named queue.py in the same directory

Method2: Queue is in the multiprocessing module so:

from multiprocessing importQueue

Method3: Updating pip from 1.5.6 to 8.1.2

`sudo python -m pip install -U pip`

Reboot system (don't know if necessary, but only after reboot new version of pip was listed) Method4:

from six.moves.queue import Queue //I don't know how u import six package

Solution 3:

In setup.py, options={"build_exe": {"packages": ["multiprocessing"]}} can also do the trick.

Solution 4:

In addition to

from multiprocessing importQueue

I rolled back to the older version of cx_freeze:

pip install cx-freeze==4.3.3

Besides, the "requests" library complained on absence of "urllib3" module. I upgraded this to requests==2.13.0 and all now works.

I'm using Python 3.4 on Win10. Hope this will help.

Post a Comment for "Importerror: No Module Named 'queue' While Running My App Freezed With Cx_freeze"