'bz2是模块不可用'在python虚拟环境中通过pip安装Pandas时

问题描述 投票:0回答:1

我正在阅读这篇文章Numpy, Scipy, and Pandas - Oh My!,安装了一些python软件包,但在安装Pandas的过程中陷入了困境:

pip install -e git+https://github.com/pydata/pandas#egg=pandas

我将'wesm'更改为'pydata'以获取最新版本,该帖子的唯一其他区别是我正在使用pythonbrew。

我发现了与错误有关的this post,但是答案中提到的bz2的Makefile在哪里?还有其他方法可以解决此问题吗?

任何帮助将不胜感激。谢谢。

python pandas pip bzip2 pythonbrew
1个回答
4
投票

您需要使用BZIP2支持来构建python。

[在构建python之前安装以下软件包:

  • Red Hat / Fedora / CentOS:yum install bzip2-devel
  • Debian / Ubuntu:sudo apt-get install libbz2-dev

提取python tarball。然后

configure;
make;
make install

使用新的python安装pip。>>

替代:

使用yum或apt安装二进制python发行版,该发行版是通过BZIP2支持构建的。

另请参见:ImportError: No module named bz2 for Python 2.7.2

© www.soinside.com 2019 - 2024. All rights reserved.