[issue20784] 'collections.abc' is no longer defined when collections is imported

Jurko Gospodnetić report at bugs.python.org
Tue Mar 11 08:45:51 CET 2014


Jurko Gospodnetić added the comment:

Item possibly related to this. When packaging a simple HelloWorld-like application like this:

  print("Hello world")
  import configparser

using cx_Freeze and Python 3.4, you get the following error on packaged application startup:

Traceback (most recent call last):
  File "C:\Program Files\Python\Python34rc3\lib\site-packages\cx_freeze-4.3.2-py3.4-win-amd64.egg\cx_Freeze\initscripts\Console3.py", line 27, in <module>
    exec(code, m.__dict__)
  File "hello_world.py", line 4, in <module>
  File "C:\Program Files\Python\Python34rc3\lib\importlib\_bootstrap.py", line 2214, in _find_and_load
    return _find_and_load_unlocked(name, import_)
  File "C:\Program Files\Python\Python34rc3\lib\importlib\_bootstrap.py", line 2203, in _find_and_load_unlocked
    module = _SpecMethods(spec)._load_unlocked()
  File "C:\Program Files\Python\Python34rc3\lib\importlib\_bootstrap.py", line 1191, in _load_unlocked
    return self._load_backward_compatible()
  File "C:\Program Files\Python\Python34rc3\lib\importlib\_bootstrap.py", line 1161, in _load_backward_compatible
    spec.loader.load_module(spec.name)
  File "C:\Program Files\Python\Python34rc3\lib\configparser.py", line 121, in <module>
    from collections.abc import MutableMapping
  File "C:\Program Files\Python\Python34rc3\lib\importlib\_bootstrap.py", line 2214, in _find_and_load
    return _find_and_load_unlocked(name, import_)
  File "C:\Program Files\Python\Python34rc3\lib\importlib\_bootstrap.py", line 2201, in _find_and_load_unlocked
    raise ImportError(_ERR_MSG.format(name), name=name)
ImportError: No module named 'collections.abc'

  As I see it, the config parser module is attempting to import
'collections.abc'.

  The same does not occur with Python 3.3.5 or 3.3.3.

  Not sure if this is due to something cx_Freeze does so it failed to collect some module in the created installation package, or if it's something to look into in Python itself. Just looked similar to this so I bring it up as additional info for anyone looking deeper into this issue.

  Hope this helps.

  Best regards,
    Jurko Gospodnetić

----------
nosy: +Jurko.Gospodnetić

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue20784>
_______________________________________


More information about the Python-bugs-list mailing list