Public bug reported:

After installing Zesty, Python 3.6 is not alpha any more. :)
Thus, I ran it and typed:

import apt_pkg

This import raised the ModuleNotFoundError exception:

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ModuleNotFoundError: No module named 'apt_pkg'
Error in sys.excepthook:
Traceback (most recent call last):
  File "/usr/lib/python3/dist-packages/apport_python_hook.py", line 63, in 
apport_excepthook
    from apport.fileutils import likely_packaged, get_recent_crashes
  File "/usr/lib/python3/dist-packages/apport/__init__.py", line 5, in <module>
    from apport.report import Report
  File "/usr/lib/python3/dist-packages/apport/report.py", line 30, in <module>
    import apport.fileutils
  File "/usr/lib/python3/dist-packages/apport/fileutils.py", line 23, in 
<module>
    from apport.packaging_impl import impl as packaging
  File "/usr/lib/python3/dist-packages/apport/packaging_impl.py", line 24, in 
<module>
    import apt
  File "/usr/lib/python3/dist-packages/apt/__init__.py", line 23, in <module>
    import apt_pkg
ModuleNotFoundError: No module named 'apt_pkg'

Original exception was:
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ModuleNotFoundError: No module named 'apt_pkg'


I then ran the following:

apt-get install --reinstall python{,3}-apt

but the problem is still present.
During the command execution I noticed that the python*-apt packages versions 
are both 1.4.0~beta2.

I went back to the CLI and tried the same with Python 2, and Python 3.5 but 
both imports worked fine.
It is thus a Python 3.6.1 issue only.

** Affects: python3.6 (Ubuntu)
     Importance: Undecided
         Status: New


** Tags: python3.6

-- 
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.
https://bugs.launchpad.net/bugs/1685596

Title:
  apt_pkg module not found by the Python 3.6.1 interpreter

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/python3.6/+bug/1685596/+subscriptions

-- 
ubuntu-bugs mailing list
ubuntu-bugs@lists.ubuntu.com
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs

Reply via email to