尝试执行以下命令时:
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
我能做些什么来解决这个问题?在
如果您自己编译python,则需要首先安装libbz2头和.so fiels,这样python就可以使用bz2支持进行编译。在
在ubuntu上,
apt-get install libbz2-dev
然后编译python。在相关问题 更多 >
编程相关推荐