You need to enable JavaScript to run this app.
最新活动
大模型
产品
解决方案
定价
生态与合作
支持与服务
开发者
了解我们

安装GroundingDINO时出现安装错误求助

安装GroundingDINO时出现安装错误求助

大家好,我按照GroundingDINO官方仓库的README说明进行本地源码安装,结果遇到了一堆报错,折腾半天没搞定,来请教各位大佬!

我是在自己创建的Python虚拟环境里操作的,执行安装命令后,先是收到了关于legacy editable install的弃用警告,接着直接报错退出。核心问题我整理出来了:

关键错误点

  1. 执行python setup.py develop失败,退出码为1
  2. 构建依赖获取阶段报错,根源是虚拟环境的Python找不到pip模块,同时也找不到torch模块
  3. 脚本尝试自动安装torch时,执行['/home/kgupta/workspace/Synthetic_Data_gen/Annotation_Agent/annotationagent/bin/python3', '-m', 'pip', 'install', 'torch']命令返回非零错误

另外还收到setuptools的警告:develop命令已被弃用,建议使用pip或uv这类标准化工具,还提到需要添加pyproject.toml文件、启用--use-pep517参数,且setuptools版本要>=64。

我手动检查过虚拟环境的pip是正常可用的,输入pip --version能正常返回信息,但不知道为什么安装脚本调用时会找不到pip。torch本来以为会被自动安装,结果也没装上。有没有大佬遇到过类似问题,给我指条解决思路呀?

完整报错日志
Obtaining file:///home/kgupta/workspace/Synthetic_Data_gen/Annotation_Agent/models/GroundingDINO
Preparing metadata (setup.py) ... done
...
Installing collected packages: groundingdino
DEPRECATION: Legacy editable install of groundingdino==0.1.0 from file:///home/kgupta/workspace/Synthetic_Data_gen/Annotation_Agent/models/GroundingDINO (setup.py develop) is deprecated. pip 25.3 will enforce this behaviour change. A possible replacement is to add a pyproject.toml or enable --use-pep517, and use setuptools >= 64. If the resulting installation is not behaving as expected, try using --config-settings editable_mode=compat. Please consult the setuptools documentation for more information. Discussion can be found in pip's GitHub repository issues.
Running setup.py develop for groundingdino
error: subprocess-exited-with-error
× python setup.py develop did not run successfully.
│ exit code: 1
╰─> [97 lines of output]
Building wheel groundingdino-0.1.0
Compiling with CUDA
running develop
/home/kgupta/workspace/Synthetic_Data_gen/Annotation_Agent/annotationagent/lib/python3.11/site-packages/setuptools/_distutils/cmd.py:90: DevelopDeprecationWarning: develop command is deprecated.
!! ********************************************************************************
Please avoid running ``setup.py`` and ``develop``. Instead, use standards-based tools like pip or uv.
By 2025-Oct-31, you need to update your project and remove deprecated calls or your builds will no longer be supported.
See setuptools' related GitHub issues for details.
********************************************************************************
!!
self.initialize_options()
Obtaining file:///home/kgupta/workspace/Synthetic_Data_gen/Annotation_Agent/models/GroundingDINO
Installing build dependencies: started
Installing build dependencies: finished with status 'done'
Checking if build backend supports build_editable: started
Checking if build backend supports build_editable: finished with status 'done'
Getting requirements to build editable: started
Getting requirements to build editable: finished with status 'error'
error: subprocess-exited-with-error
× Getting requirements to build editable did not run successfully.
│ exit code: 1
╰─> [33 lines of output]
/home/kgupta/workspace/Synthetic_Data_gen/Annotation_Agent/annotationagent/bin/python3: No module named pip
Traceback (most recent call last):
File "<string>", line 32, in install_torch
ModuleNotFoundError: No module named 'torch'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/home/kgupta/workspace/Synthetic_Data_gen/Annotation_Agent/annotationagent/lib/python3.11/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 389, in <module>
main()
File "/home/kgupta/workspace/Synthetic_Data_gen/Annotation_Agent/annotationagent/lib/python3.11/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 373, in main
json_out["return_val"] = hook(**hook_input["kwargs"])
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/kgupta/workspace/Synthetic_Data_gen/Annotation_Agent/annotationagent/lib/python3.11/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 157, in get_requires_for_build_editable
return hook(config_settings)
^^^^^^^^^^^^^^^^^^^^^
File "/tmp/pip-build-env-ozwbekvd/overlay/lib/python3.11/site-packages/setuptools/build_meta.py", line 473, in get_requires_for_build_editable
return self.get_requires_for_build_wheel(config_settings)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/tmp/pip-build-env-ozwbekvd/overlay/lib/python3.11/site-packages/setuptools/build_meta.py", line 331, in get_requires_for_build_wheel
return self._get_build_requires(config_settings, requirements=[])
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/tmp/pip-build-env-ozwbekvd/overlay/lib/python3.11/site-packages/setuptools/build_meta.py", line 301, in _get_build_requires
self.run_setup()
File "/tmp/pip-build-env-ozwbekvd/overlay/lib/python3.11/site-packages/setuptools/build_meta.py", line 512, in run_setup
super().run_setup(setup_script=setup_script)
File "/tmp/pip-build-env-ozwbekvd/overlay/lib/python3.11/site-packages/setuptools/build_meta.py", line 317, in run_setup
exec(code, locals())
File "<string>", line 37, in <module>
File "<string>", line 34, in install_torch
File "/home/kgupta/miniconda3/lib/python3.11/subprocess.py", line 413, in check_call
raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command '['/home/kgupta/workspace/Synthetic_Data_gen/Annotation_Agent/annotationagent/bin/python3', '-m', 'pip', 'install', 'torch']' returned non-zero exit status 1.
[end of output]

火山引擎 最新活动