[New-bugs-announce] [issue43471] Fails to import bz2 on Ubuntu

Xinmeng Xia report at bugs.python.org
Thu Mar 11 02:20:37 EST 2021


New submission from Xinmeng Xia <xiaxm at smail.nju.edu.cn>:

Module bz2 fails to be imported on Ubuntu due to lack of '_bz2'.  We try "import bz2" on Mac, it can work well.

Errors on Ubuntu
==========================================
>>import bz2
Traceback (most recent call last):
      File "/home/xxm/Desktop/apifuzz/doc/genDoc.py", line 97, in <module>
           exec(compile(mstr,'','exec'))
      File "", line 1, in <module>
           File "/home/xxm/Desktop/apifuzz/Python-3.9.2/Lib/bz2.py", line 18, in <module>
                from _bz2 import BZ2Compressor, BZ2Decompressor
ModuleNotFoundError: No module named '_bz2'
===========================================

Python version: 3.9.2
Python installation: (1). download source code from python.org, (2). run command "./configure; sudo make; sudo make install.

We install the same Python 3.9.2 in a same way on Mac and Ubuntu.

----------
components: Library (Lib)
messages: 388483
nosy: xxm
priority: normal
severity: normal
status: open
title: Fails to import bz2 on Ubuntu
type: behavior
versions: Python 3.9

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue43471>
_______________________________________


More information about the New-bugs-announce mailing list