首页 > 解决方案 > 如何解决“没有名为 _bz2 的模块”错误?

问题描述

我正在尝试s3fs使用 Debian 3.16.51-3 在 Python 3.6 中使用。

当我导入 s3fs 时:

import s3fs

...
from _bz2 import BZ2Compressor, BZ2Decompressor

ModuleNotFoundError: No module named '_bz2'

好的,我尝试更新/安装libbz2-dev,如 SO 中的其他问题所述。

sudo apt-get install libbz2-dev

Reading package lists... Done
Building dependency tree
Reading state information... Done
The following extra packages will be installed:
  bzip2 bzip2-doc libbz2-1.0
The following NEW packages will be installed:
  bzip2-doc libbz2-dev
The following packages will be upgraded:
  bzip2 libbz2-1.0
2 upgraded, 2 newly installed, 0 to remove and 151 not upgraded.
Need to get 425 kB of archives.
After this operation, 561 kB of additional disk space will be used.
Do you want to continue? [Y/n] y
Err http://security.debian.org/ jessie/updates/main bzip2 amd64 1.0.6-7+deb8u1
  404  Not Found [IP: 151.101.128.204 80]
Err http://security.debian.org/ jessie/updates/main libbz2-1.0 amd64 1.0.6-7+deb8u1
  404  Not Found [IP: 151.101.128.204 80]
Err http://security.debian.org/ jessie/updates/main bzip2-doc all 1.0.6-7+deb8u1
  404  Not Found [IP: 151.101.128.204 80]
Err http://security.debian.org/ jessie/updates/main libbz2-dev amd64 1.0.6-7+deb8u1
  404  Not Found [IP: 151.101.128.204 80]
E: Failed to fetch http://security.debian.org/pool/updates/main/b/bzip2/bzip2_1.0.6-7+deb8u1_amd64.deb  404  Not Found [IP: 151.101.128.204 80]

E: Failed to fetch http://security.debian.org/pool/updates/main/b/bzip2/libbz2-1.0_1.0.6-7+deb8u1_amd64.deb  404  Not Found [IP: 151.101.128.204 80]

E: Failed to fetch http://security.debian.org/pool/updates/main/b/bzip2/bzip2-doc_1.0.6-7+deb8u1_all.deb  404  Not Found [IP: 151.101.128.204 80]

E: Failed to fetch http://security.debian.org/pool/updates/main/b/bzip2/libbz2-dev_1.0.6-7+deb8u1_amd64.deb  404  Not Found [IP: 151.101.128.204 80]

E: Unable to fetch some archives, maybe run apt-get update or try with --fix-missing?

尝试使用--fix-missing,但遇到了同样的错误。显然这些文件不可下载(?)。

我应该如何解决这个问题?提前致谢。

标签: python-3.xdebianpython-s3fs

解决方案


推荐阅读