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

使用uv导入嵌套模块时遇到ModuleNotFoundError及Python版本兼容问题求助

使用uv导入嵌套模块时遇到ModuleNotFoundError及Python版本兼容问题求助

我正在用uv管理一个项目,项目的文件结构如下:

- src
  - app.py
  - constants.py
- notebooks
  - testing.ipynb
- pyproject.toml

我的pyproject.toml文件内容为:

[project]
name = "benchmark-extractor"
version = "0.1.0"
description = "Add your description here"
readme = "README.md"
requires-python = ">=3.13"
dependencies = [
    "anthropic>=0.42.0",
    "ipykernel>=6.29.5",
    "markitdown>=0.0.1a3",
    "pandera>=0.22.1",
    "tabula-py>=2.10.0",
]

出于实验需求,我想把app.py和constants.py导入到notebooks/testing.ipynb中,但直接用import src.app这种方式尝试时,会出现*"ModuleNotFoundError"*错误。

我原本打算用uv pip install -e .的方法来解决这个问题,但运行这个命令后,却收到了如下错误提示:

ERROR: Package 'benchmark-extractor' requires a different Python: 3.11.3 not in '>=3.13'

备注:内容来源于stack exchange,提问作者Nik

相关产品推荐
方舟 Agent Plan

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

最近更新时间:2026.04.14 12:54:35