安装pystan conda安装 MingW-w64编译器

安装C ++编译器

有几种方法可以安装MingW-w64编译器工具链,但是在这些说明中conda使用Anaconda软件包附带的软件包管理器安装编译器。

要安装MingW-w64编译器类型:

``conda install libpython m2w64-toolchain -c msys2``

这将安装

  • libpython 导入MingW-w64所需的包。

https://anaconda.org/anaconda/libpython > - MingW-w64工具链。< https://anaconda.org/msys2/m2w64-toolchain >

libpython自动设置distutils.cfg文件,但如果失败,请使用以下说明手动设置

在PYTHONPATH \ Lib \ distutils中使用文本编辑器创建distutils.cfg(例如记事本,记事本++)并添加以下行:

[build]
compiler=mingw32

要找到正确的distutils路径,请运行python:

>>> import distutils
>>> print(distutils.__file__)

安装依赖项

建议在Windows上使用conda和conda-forgechannel 安装依赖项。必需的依赖项是numpycython。:

``conda install numpy cython -c conda-forge``

可选的依赖关系matplotlibscipy并且pandas

``conda install matplotlib scipy pandas -c conda-forge``

安装PyStan 

您可以使用pip(推荐)或conda安装PyStan

与pip:

pip install pystan

并与康达

conda安装pystan -c conda-forge

您可以通过打开Python终端(python从命令提示符运行)并从非常简单的模型中绘制样本来验证是否已成功安装所有内容:

>>> import pystan
>>> model_code = 'parameters {real y;} model {y ~ normal(0,1);}'
>>> model = pystan.StanModel(model_code=model_code)
>>> y = model.sampling().extract()['y']
>>> y.mean()  # with luck the result will be near 0

步骤

随着pip

conda install numpy cython matplotlib scipy pandas -c conda-forge pip install pystan

用conda

conda install numpy cython matplotlib scipy pandas pystan -c conda-forge

  • 1
    点赞
  • 6
    收藏
    觉得还不错? 一键收藏
  • 2
    评论
评论 2
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值