Skip to content

Chapter14:后端依赖安装问题 #373

@oscarljy118-code

Description

@oscarljy118-code

1. 遇到问题的章节 / Affected Chapter

Chapter14

2. 问题类型 / Issue Type

代码错误 / Code Error

3. 具体问题描述 / Problem Description

执行“14.1.3 快速体验:5 分钟运行项目。”中后端部分环境配置中的如下部分时

# 2. 安装依赖
# 方式1:使用uv(推荐,更快的Python包管理器)
uv sync

# 方式2:使用pip
pip install -e .

出现报错
error: package directory 'src\src' does not exist

4. 问题重现材料 / Reproduction Materials

完整错误信息

PS E:\GIS_RS_IT\Mphil\agent\Deep Research\hello-agents\code\chapter14\helloagents-deepresearch\backend> pip install -e . Obtaining file:///E:/GIS_RS_IT/Mphil/agent/Deep%20Research/hello-agents/code/chapter14/helloagents-deepresearch/backend Installing build dependencies ... done Checking if build backend supports build_editable ... done Getting requirements to build editable ... error error: subprocess-exited-with-error × Getting requirements to build editable did not run successfully. │ exit code: 1 ╰─> [24 lines of output] C:\Users\Lenovo\AppData\Local\Temp\pip-build-env-mau8dsvv\overlay\Lib\site-packages\setuptools\config\expand.py:126: SetuptoolsWarning: File 'E:\GIS_RS_IT\Mphil\agent\Deep Research\hello-agents\code\chapter14\helloagents-deepresearch\backend\README.md' cannot be found return '\n'.join( C:\Users\Lenovo\AppData\Local\Temp\pip-build-env-mau8dsvv\overlay\Lib\site-packages\setuptools\config_apply_pyprojecttoml.py:82: SetuptoolsDeprecationWarning: project.license as a TOML table is deprecated !! ******************************************************************************** Please use a simple string containing a SPDX expression for project.license. You can also use project.license-files. (Both options available on setuptools>=77.0.0). By 2027-Feb-18, you need to update your project and remove deprecated calls or your builds will no longer be supported. See https://packaging.python.org/en/latest/guides/writing-pyproject-toml/#license for details. ******************************************************************************** !! corresp(dist, value, root_dir) running egg_info creating src\helloagents_deep_researcher.egg-info writing src\helloagents_deep_researcher.egg-info\PKG-INFO writing dependency_links to src\helloagents_deep_researcher.egg-info\dependency_links.txt writing requirements to src\helloagents_deep_researcher.egg-info\requires.txt writing top-level names to src\helloagents_deep_researcher.egg-info\top_level.txt writing manifest file 'src\helloagents_deep_researcher.egg-info\SOURCES.txt' error: package directory 'src\src' does not exist [end of output] note: This error originates from a subprocess, and is likely not a problem with pip. error: subprocess-exited-with-error × Getting requirements to build editable did not run successfully. │ exit code: 1 ╰─> See above for output.

5. 补充信息 / Additional Information

可能原因是Windows下路径严格,必须目录和包名完全对应。将 backend/pyproject.toml 中的

[tool.setuptools]
packages = ["src"]

改成

[tool.setuptools]
packages = { find = { where = ["src"] } }

可以解决。

确认事项 / Verification

  • 我已阅读过相关章节的文档 / I have read the relevant chapter documentation
  • 我已搜索过现有的Issues,确认此问题未被报告 / I have searched existing Issues and confirmed this hasn't been reported
  • 我已尝试过基本的故障排除(如重启、重新安装依赖等) / I have tried basic troubleshooting (restart, reinstall dependencies, etc.)

Metadata

Metadata

Assignees

No one assigned

    Labels

    documentationImprovements or additions to documentation

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions