You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

在Python中安装QuantLib库失败的问题求助

解决PyCharm中安装QuantLib库的版本匹配问题

问题描述

尝试在PyCharm中安装QuantLib库时遇到以下错误:

ERROR: Could not find a version that satisfies the requirement QuantLib (from versions: none)
ERROR: No matching distribution found for QuantLib

[notice] A new release of pip available: 22.3.1 -> 23.1
[notice] To update, run: pip install --upgrade pip

已升级pip但问题未解决,使用Python 3.7.16,尝试安装PyPI上的QuantLib-Python库(版本1.18)时,仍出现依赖错误:

Collecting QuantLib-Python==1.18
  Using cached QuantLib_Python-1.18-py2.py3-none-any.whl (1.4 kB)

ERROR: Could not find a version that satisfies the requirement QuantLib (from quantlib-python) (from versions: none)
ERROR: No matching distribution found for QuantLib

[notice] A new release of pip available: 22.3.1 -> 23.1
[notice] To update, run: pip install --upgrade pip

解决方案

  • 指定兼容版本安装:Python 3.7的预编译QuantLib包在PyPI上仅保留部分旧版本,尝试安装适配的版本,比如:

    pip install QuantLib==1.27
    

    这个版本是最后一批支持Python 3.7的预编译包之一。

  • 从源码编译安装:如果没有合适的预编译包,直接编译源码:

    1. 安装C++编译器(如Visual Studio、GCC)和CMake工具
    2. 下载QuantLib核心库源码并编译安装
    3. 安装QuantLib-Python绑定:
      pip install QuantLib-Python
      
      或从QuantLib-Python源码编译安装。
  • 升级Python版本:切换到Python 3.8及以上版本,PyPI上提供对应版本的预编译QuantLib包,直接执行:

    pip install QuantLib
    

    即可完成安装。

  • 使用conda安装:若使用conda环境,通过conda-forge源安装,自动处理依赖和版本匹配:

    conda install -c conda-forge quantlib-python
    

内容的提问来源于stack exchange,提问作者Devarshi Goswami

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.07.24 21:22:18