[issue16047] Tools/freeze no longer works in Python 3

Christian Bachmaier report at bugs.python.org
Tue Mar 25 17:47:36 CET 2014


Christian Bachmaier added the comment:

> To test what I asked for, please run freeze on this script:
> 
> """
> import _psycopg2
> print ('Works.')
> """

$ xxx/freeze.py hello.py
$ make
$ ./hello
Traceback (most recent call last):
  File "hello.py", line 3, in <module>
    import _psycopg2
  File "/usr/lib/python3.4/importlib/_bootstrap.py", line 2214, in _find_and_load
    return _find_and_load_unlocked(name, import_)
  File "/usr/lib/python3.4/importlib/_bootstrap.py", line 2201, in _find_and_load_unlocked
    raise ImportError(_ERR_MSG.format(name), name=name)
ImportError: No module named '_psycopg2'

Btw the same with import psycopg2, psycopg2._psycopg, or _psycopg. Event with the subdir link as explained above. The first one (import psycopg2) is the one which operates in interpretation mode.

> If it prints 'Works.', then your problem is unrelated to this
> ticket.

Nop, prints the error message instead of 'Works.'

> If it fails with an import error or some other error
> related to loading the shared lib, then it may be a problem
> with freeze and is likely related to the new import lib
> machinery.

=> we have a bug if Marc-Andre is right. Thanks.

Chris

----------

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


More information about the Python-bugs-list mailing list