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

如何解决Kaggle/Colab中pip安装optuna-integration的报错问题

安装optuna-integration时的连接报错及解决建议

问题详情

执行命令 !pip install optuna-integration 后出现DNS解析失败的报错,具体信息如下:

WARNING: Retrying (Retry(total=4, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError('<pip._vendor.urllib3.connection.HTTPSConnection object at 0x7944200bc370>: Failed to establish a new connection: [Errno -3] Temporary failure in name resolution')': /simple/optuna-integration/
WARNING: Retrying (Retry(total=3, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError('<pip._vendor.urllib3.connection.HTTPSConnection object at 0x7944200bc670>: Failed to establish a new connection: [Errno -3] Temporary failure in name resolution')': /simple/optuna-integration/
WARNING: Retrying (Retry(total=2, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError('<pip._vendor.urllib3.connection.HTTPSConnection object at 0x7944200bc910>: Failed to establish a new connection: [Errno -3] Temporary failure in name resolution')': /simple/optuna-integration/
WARNING: Retrying (Retry(total=1, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError('<pip._vendor.urllib3.connection.HTTPSConnection object at 0x7944200bcac0>: Failed to establish a new connection: [Errno -3] Temporary failure in name resolution')': /simple/optuna-integration/
WARNING: Retrying (Retry(total=0, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError('<pip._vendor.urllib3.connection.HTTPSConnection object at 0x7944200bcc70>: Failed to establish a new connection: [Errno -3] Temporary failure in name resolution')': /simple/optuna-integration/
ERROR: Could not find a version that satisfies the requirement optuna-integration (from versions: none)
ERROR: No matching distribution found for optuna-integration

已确认未启用VPN、未使用8.8.8.8 DNS及代理,问题仍未解决。

解决建议

  • 切换国内PyPI镜像源:官方源访问不稳定可能导致DNS解析失败,尝试用国内镜像加速安装:
    !pip install optuna-integration -i https://pypi.tuna.tsinghua.edu.cn/simple
    
  • 检查网络连通性:在终端执行 ping pypi.org,确认能否正常连通。若不通,可切换到国内公共DNS(如114.114.114.114)后重试。
  • 核实包名正确性:确认包名是否为optuna-integration,避免因包名错误导致安装失败。
  • 更新pip版本:旧版pip可能存在兼容性问题,先更新再安装:
    !pip install --upgrade pip -i https://pypi.tuna.tsinghua.edu.cn/simple
    !pip install optuna-integration -i https://pypi.tuna.tsinghua.edu.cn/simple
    
  • 离线安装备选:若网络问题无法解决,在能正常访问PyPI的环境下载.whl或.tar.gz格式的安装包,传输到目标环境后执行本地安装:
    !pip install /path/to/optuna_integration_package.whl
    

内容的提问来源于stack exchange,提问作者DRACO HO

相关产品推荐
方舟 Agent Plan

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

最近更新时间:2026.06.21 08:17:24