如何避免 windows 上的 statsmodels 安装错误?

How to avoid statsmodels installation errors on windows ?

这几天我一直在寻找安装 statsmodel 的方法。 我想使用 ggplot 库。

它的依赖项在 web site;

中说明
  1. matplotlib
  2. pandas
  3. scipy
  4. numpy
  5. 统计模型

matplotlib, pandas, scipy 和 numpy 已成功安装到我的电脑上。

然后我在命令提示符下键入 pip install --upgrade --no-deps statsmodels,过了一会儿我得到以下 error;

异常:未找到 Cython 生成的文件 'statsmodels/nonparametric/linbin.c'。 Cython 需要从开发分支编译 statsmodels。请安装 Cython 或下载 statsmodels 的源版本。

我已经使用 pip 和以下命令安装了 cython;

pip install cython

我试过安装并再次出现同样的错误。 然后我使用以下命令将源代码从 github 克隆到我的计算机;

git clone git://github.com/statsmodels/statsmodels.git

我导航到安装路径并尝试从 setup.py 文件安装;

python setup.py install

从这个安装我得到以下错误;

文件"C:\user\AppData\Local\Programs\Python\Python35\lib\encodings\cp1254.py",第23行,解码中 return codecs.charmap_decode(输入,self.errors,decoding_table)[0] UnicodeDecodeError:'charmap' 编解码器无法解码位置 330 中的字节 0x8d:字符映射到

有没有人有办法解决这个问题?

Python 版本:3.5.2

matplotlib 版本:2.0.2

scipy 版本:1.0.0

numpy 版本:1.14.0

pandas 版本:0.22.0

我从 "Unofficial Windows Binaries for Python Extension Packages" 页面安装了 statsmodels:www.lfd.uci.edu/~gohlke/pythonlibs in windows 10.