python - import pystan._api failed:ImportError: DLL load failed: 找不到指定的模块
问题描述
我已经安装了 python 3.7 并想使用 fbprophet ( https://facebook.github.io/prophet/docs/installation.html#python )进行一些预测
但是在使用命令安装软件包时出现此错误(pip install fbprophet)
import pystan
File "e:\repos\usf\venv\lib\site-packages\pystan\__init__.py", line 9, in <module>
from pystan.api import stanc, stan
File "e:\repos\usf\venv\lib\site-packages\pystan\api.py", line 13, in <module>
import pystan._api # stanc wrapper
ImportError: DLL load failed: The specified module could not be found.
我做了一些研究,并知道这可以通过 conda 实现。但我正在寻找不使用 conda 的解决方案。
提前致谢。
解决方案
它在Pystan 文档中说,在 Windows 上配置 C++ 编译器可能具有挑战性。以下方法适用于我安装 Pystan 2.17.1 和 FBProphet 0.6:
安装 C++ 编译器,mingw-w64 ( http://mingw-w64.org/doku.php/download ) -> 我选择了这个https://sourceforge.net/projects/mingw-w64/files/
将 C:<MinGW_w64 安装目录>\bin 添加到 PATH 环境变量中
在 Python 安装目录(在 venv 中)的文件夹 \Lib\distutils 中创建具有以下内容的 distutils.cfg 文件:
[构建] 编译器=mingw32
[build_ext] 编译器=mingw32
点安装 numpy cython
pip install pystan==2.17.1
验证 Pystan 安装 ( https://pystan.readthedocs.io/en/latest/windows.html )
pip install fbprophet==0.6
推荐阅读
- mysql - 错误 错误:ER_BAD_FT_COLUMN:列“大小”不能是 FULLTEXT 索引的一部分
- javascript - 为什么这些筛子优化会破坏我的代码?
- python - 给定两个矩阵和一个带有两个向量的函数,如何向量化矩阵中每对向量的函数均值?
- c++ - 恢复生命周期已结束的对象的成员函数协程是UB吗?
- java - 访问扩展通用数组列表中的对象变量
- swift - 使用嵌套 UIView 动画缩放 UIView
- laravel - Laravel生成pdf时如何设置语言
- javascript - 将 React 类组件转换为具有许多回报的功能组件
- qr-code - 一个二维码可以处理多少个纯文本字符?
- regex - 使用正则表达式模式从日志文件中解析数据