ImportError: No module named 'queue' while running my app freezed with cx_freeze

modulenotfounderror: no module named
importerror: no module named py
importerror: no module named mac
importerror: no module named linux
importerror: cannot import name
python no module named same directory
importerror no module named xyz
importerror: no module named typing

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 script successfully too with cx_freeze.

C:\Program Files (x86)\utils>utils.exe
Traceback (most recent call last):
  File "C:\Python34\lib\site-packages\requests\packages\__init__.py", line 27, i
n <module>
    from . import urllib3
  File "C:\Python34\lib\site-packages\requests\packages\urllib3\__init__.py", line 8, in <module>
    from .connectionpool import (
  File "C:\Python34\lib\site-packages\requests\packages\urllib3\connectionpool.py", line 28, in <module>
    from .packages.six.moves.queue import LifoQueue, Empty, Full
  File "C:\Python34\lib\site-packages\requests\packages\urllib3\packages\six.py", line 203, in load_module
    mod = mod._resolve()
  File "C:\Python34\lib\site-packages\requests\packages\urllib3\packages\six.py", line 115, in _resolve
    return _import_module(self.mod)
  File "C:\Python34\lib\site-packages\requests\packages\urllib3\packages\six.py", line 82, in _import_module
    __import__(name)
ImportError: No module named 'queue'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "C:\Python34\lib\site-packages\cx_Freeze\initscripts\__startup__.py", line 12, in <module>
    __import__(name + "__init__")
  File "C:\Python34\lib\site-packages\cx_Freeze\initscripts\Console.py", line 21, in <module>
    scriptModule = __import__(moduleName)
  File "utils.py", line 3, in <module>
  File "C:\Python34\lib\site-packages\requests\__init__.py", line 63, in <module>
    from . import utils
  File "C:\Python34\lib\site-packages\requests\utils.py", line 24, in <module>
    from ._internal_utils import to_native_string
  File "C:\Python34\lib\site-packages\requests\_internal_utils.py", line 11, in <module>
    from .compat import is_py2, builtin_str
  File "C:\Python34\lib\site-packages\requests\compat.py", line 11, in <module>
    from .packages import chardet
  File "C:\Python34\lib\site-packages\requests\packages\__init__.py", line 29, in <module>
    import urllib3
  File "C:\Python34\lib\site-packages\urllib3\__init__.py", line 8, in <module>
    from .connectionpool import (
  File "C:\Python34\lib\site-packages\urllib3\connectionpool.py", line 28, in <module>
    from .packages.six.moves.queue import LifoQueue, Empty, Full
  File "C:\Python34\lib\site-packages\urllib3\packages\six.py", line 203, in load_module
    mod = mod._resolve()
  File "C:\Python34\lib\site-packages\urllib3\packages\six.py", line 115, in _resolve
    return _import_module(self.mod)
  File "C:\Python34\lib\site-packages\urllib3\packages\six.py", line 82, in _import_module
    __import__(name)
ImportError: No module named 'queue'

Even tried installing package 'six' with no help. My setup.py is from cx_Freeze import setup, Executable import requests.certs

setup(
name = "utils" ,
version = "0.1" ,
description = " utils for accounts" ,
executables = [Executable("utils.py")],
options = {"build_exe": {"packages": ["urllib", "requests"],"include_files":[(requests.certs.where(),'cacert.pem')]}},

)

script imports following module

import requests
import urllib.request
import uuid
import json
import http.client
from xml.dom import minidom

Any help will be highly appreciated. please see me as novice in python

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 import Queue

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

Traps for the Unwary in Python's Import System — Nick Coghlan's , This has changed in Python 3.3: now any directory on sys.path with a name that "<string>", line 1, in <module> ImportError: No module named example.foo. I have been running that code on the IDLE Python GUI >>> import wx Traceback (most recent call last): File "<pyshell#10>", line 1, in <module> import wx ImportError: No module named wx – Luke Bream Dec 22 '11 at 21:14

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 import Queue

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

Python error “ImportError: No module named”, To get rid of this error you just need to create __init__.py in the appropriate directory and everything will work fine. To know more about this you� If you are getting “ImportError: No module named flask” while running python flask hello world application, then follow this tutorial to resolve the error.

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

ImportError: No module named 'XYZ' | by Yufeng, ImportError: No module named 'XYZ'. Jupyter notebook cannot find the package you already installed? Let's solve the problem. Fatal Python error: Py_Initialize: unable to load the file system codec ImportError: No module named 'encodings' Current thread 0x00001db4 (most recent call first): Fixing this is really simple: When you download Python3.x version, and run the .exe file, it gives you an option to customize where in your system you want to install Python.

In addition to

from multiprocessing import Queue

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.

Python error “ImportError: No module named”, No module named”. 0 votes. My directory tree looks like this: (local directory)/ site-packages/toolkit/interface.py. My code is in here: I did python3 cloudfail.py and I already have it installed and it says this: Traceback (most recent call last): File "cloudfail.py", line 10, in <module> import colorama ImportError: No module named 'colorama'

ImportError: No module named github � Issue #856 � PyGithub , I'm trying to use PyGitHub and I'm getting "ImportError: No module named github". Setup specs: macOS v10.13.6 Python v3.7.0 Installed with� ImportError: No module named jinja2. Ask Question Asked 6 years, 10 months ago. Active 2 years, 11 months ago. Viewed 64k times 27. 8. Using google-app-engine

ImportError: No module named _StGermain � Issue #438, ImportError: No module named _StGermain #438. Closed. FifteenOUC opened this issue on Nov 14, 2019 � 5 comments. Closed� ImportError: No module named 'pygame' Ask Question Asked 6 years, 11 months ago. Active 3 months ago. Viewed 200k times 41. 7. I have installed python 3.3.2 and

ImportError: No module named error, import urllib.error ImportError: No module named error[/inline] Could this be a problem with something in the script, or my Python configuration,� sudo python testRpiGpio.py Traceback (most recent call last): File "testRpiGpio.py", line 7, in <module> import RPi.GPIO as GPIO ImportError: No module named RPi.GPIO I installed it with the command, but I also tried virtualenv and sudo: pip install RPi.GPIO --user I am running Ubuntu on a Up Squared, so it wasn't installed by default.

Comments
  • I am having the exact same problem. Did u figure it out?
  • in setup.py, options={"build_exe": {"packages": ["multiprocessing"]}} can also do the trick (I'm running cx_Freeze 6.0b1)
  • At least with cx_Freeze 6.0b1
  • I tried "pip install cx-freeze==4.3.3" Now I cant even use cx_freeze: "No module named cx_freeze" PLEASE HELP. How do I turn it back to the latest version?!
  • pip install cx-freeze --upgrade