【问题标题】:How to update to the developer version of statsmodels using Conda?如何使用 Conda 更新到 statsmodels 的开发者版本?
【发布时间】:2020-01-12 02:10:02
【问题描述】:

我目前正在尝试将我在 Conda 中的 statsmodels 包更新为开发人员版本 statsmodels v0.11.0dev0。

由于我对 Python 比较陌生,因此我很难理解有关如何更新到开发人员版本的不同线程。

在https://www.statsmodels.org/dev/install.html 上给出了有关如何安装开发者版本的简短提示,但我无法遵循。

我已经尝试过 pip install -e 和 python setup.py develop。

为了具体更新statsmodel包,我需要在前面放什么?一个循序渐进的例子会非常有帮助并受到高度赞赏。

【问题讨论】:

    标签: regression version statsmodels rolling-computation


    【解决方案1】:

    正常安装

    (此处不适用于回答问题)

    https://www.statsmodels.org/dev/install.html 中的文档清楚地指出了两种安装 statsmodels 的方法:

    对于第一个选项,您需要 install Anaconda 才能运行 conda install -c conda-forge statsmodels。

    另一方面,git is required。然后克隆 github 存储库,以便能够运行 pip install git+https://github.com/statsmodels/statsmodels 和 python setup.py install。

    开发者版本

    运行以下步骤:

    1) git clone git://github.com/statsmodels/statsmodels.git
    2) pip install cython
    3) pip install -r requirements.txt
    4) python setup.py 开发

    这会导致正确编译 c 文件:

    Compiling statsmodels/tsa/statespace/_initialization.pyx because it changed.
    Compiling statsmodels/tsa/statespace/_representation.pyx because it changed.
    Compiling statsmodels/tsa/statespace/_kalman_filter.pyx because it changed.
    Compiling statsmodels/tsa/statespace/_filters/_inversions.pyx because it changed.
    Compiling statsmodels/tsa/statespace/_filters/_univariate.pyx because it changed.
    Compiling statsmodels/tsa/statespace/_filters/_univariate_diffuse.pyx because it changed.
    Compiling statsmodels/tsa/statespace/_kalman_smoother.pyx because it changed.
    Compiling statsmodels/tsa/statespace/_smoothers/_alternative.pyx because it changed.
    Compiling statsmodels/tsa/statespace/_smoothers/_classical.pyx because it changed.
    Compiling statsmodels/tsa/statespace/_smoothers/_conventional.pyx because it changed.
    Compiling statsmodels/tsa/statespace/_smoothers/_univariate.pyx because it changed.
    Compiling statsmodels/tsa/statespace/_smoothers/_univariate_diffuse.pyx because it changed.
    Compiling statsmodels/tsa/statespace/_simulation_smoother.pyx because it changed.
    Compiling statsmodels/tsa/statespace/_tools.pyx because it changed.
    [ 1/14] Cythonizing statsmodels/tsa/statespace/_filters/_inversions.pyx
    [ 2/14] Cythonizing statsmodels/tsa/statespace/_filters/_univariate.pyx
    [ 3/14] Cythonizing statsmodels/tsa/statespace/_filters/_univariate_diffuse.pyx
    [ 4/14] Cythonizing statsmodels/tsa/statespace/_initialization.pyx
    [ 5/14] Cythonizing statsmodels/tsa/statespace/_kalman_filter.pyx
    [ 6/14] Cythonizing statsmodels/tsa/statespace/_kalman_smoother.pyx
    [ 7/14] Cythonizing statsmodels/tsa/statespace/_representation.pyx
    [ 8/14] Cythonizing statsmodels/tsa/statespace/_simulation_smoother.pyx
    [ 9/14] Cythonizing statsmodels/tsa/statespace/_smoothers/_alternative.pyx
    [10/14] Cythonizing statsmodels/tsa/statespace/_smoothers/_classical.pyx
    [11/14] Cythonizing statsmodels/tsa/statespace/_smoothers/_conventional.pyx
    [12/14] Cythonizing statsmodels/tsa/statespace/_smoothers/_univariate.pyx
    [13/14] Cythonizing statsmodels/tsa/statespace/_smoothers/_univariate_diffuse.pyx
    warning: statsmodels/tsa/statespace/_smoothers/_univariate_diffuse.pyx:555:14: Unreachable code
    warning: statsmodels/tsa/statespace/_smoothers/_univariate_diffuse.pyx:1130:14: Unreachable code
    warning: statsmodels/tsa/statespace/_smoothers/_univariate_diffuse.pyx:1705:14: Unreachable code
    warning: statsmodels/tsa/statespace/_smoothers/_univariate_diffuse.pyx:2280:14: Unreachable code
    [14/14] Cythonizing statsmodels/tsa/statespace/_tools.pyx
    [some compiler warnings are shown here]
    5 warnings generated.
    

    我已经在 Mac 上对此进行了测试,并且还通过 Xcode 安装了 gcc,但不确定这是否在这里起作用。

    【讨论】:

    • 感谢您的回复。但是,您的回答说明了如何安装 statsmodels,我目前正在寻找安装开发人员版本的解决方案。不知何故,我想我需要一个 C 编译器来让它运行
    • 所以,你需要克隆 repo,安装 cyphon 和需求,然后运行 ​​python setup.py develop。我在本地测试后更新了答案。
    猜你喜欢
    • 2017-02-19
    • 1970-01-01
    • 2014-07-08
    • 1970-01-01
    • 2020-10-12
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多