python3中没有名为''u bz2'的模块

2024-05-29 12:00:44 发布

您现在位置:Python中文网/ 问答频道 /正文

尝试执行以下命令时:

import matplotlib.pyplot as plt

出现以下错误:

from _bz2 import BZ2Compressor, BZ2Decompressor ImportError: No module named '_bz2'

所以,我试图在Ubuntu中安装bzip2模块,方法是:

sudo pip3 install bzip2

但是,在终端中弹出以下语句:

Could not find a version that satisfies the requirement bzip2 (from versions: ) No matching distribution found for bzip2

我能做些什么来解决这个问题?在


Tags: nofromimport命令matplotlibas错误plt
1条回答
网友
1楼 · 发布于 2024-05-29 12:00:44

如果您自己编译python,则需要首先安装libbz2头和.so fiels,这样python就可以使用bz2支持进行编译。在

在ubuntu上,apt-get install libbz2-dev然后编译python。在

相关问题 更多 >

    热门问题