首页 > 其他分享 >GroundingDINO安装报错解决

GroundingDINO安装报错解决

时间:2023-11-26 14:58:04浏览次数:41  
标签:x86 linux 报错 build pycocotools pip 64 GroundingDINO 安装

title: GroundingDINO安装报错解决
banner_img: https://drive.studyinglover.com/api/raw/?path=/photos/blog/background/1679397024795.jpeg
date: 2023-6-21 17:25:00
categories:
- 踩坑

GroundingDINO安装报错解决

在安装会遇到这个错误

  ERROR: Command errored out with exit status 1:
   command: /usr/bin/python3 /tmp/tmpmhvo4wyp build_wheel /tmp/tmp3a4xwmi4
       cwd: /tmp/pip-install-x0mg8qpf/pycocotools
  Complete output (77 lines):
  running bdist_wheel
  running build
  running build_py
  creating build
  creating build/lib.linux-x86_64-cpython-38
  creating build/lib.linux-x86_64-cpython-38/pycocotools
  copying pycocotools/coco.py -> build/lib.linux-x86_64-cpython-38/pycocotools
  copying pycocotools/mask.py -> build/lib.linux-x86_64-cpython-38/pycocotools
  copying pycocotools/cocoeval.py -> build/lib.linux-x86_64-cpython-38/pycocotools
  copying pycocotools/__init__.py -> build/lib.linux-x86_64-cpython-38/pycocotools
  running build_ext
  cythoning pycocotools/_mask.pyx to pycocotools/_mask.c
  building 'pycocotools._mask' extension
  creating build/temp.linux-x86_64-cpython-38
  creating build/temp.linux-x86_64-cpython-38/common
  creating build/temp.linux-x86_64-cpython-38/pycocotools
  x86_64-linux-gnu-gcc -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O2 -Wall -g -fstack-protector-strong -Wformat -Werror=format-security -g -fwrapv -O2 -fPIC -I/tmp/pip-build-env-xkmgfc0t/overlay/lib/python3.8/site-packages/numpy/core/include -I./common -I/usr/include/python3.8 -c ./common/maskApi.c -o build/temp.linux-x86_64-cpython-38/./common/maskApi.o -Wno-cpp -Wno-unused-function -std=c99
  ./common/maskApi.c: In function ‘rleToBbox’:
  ./common/maskApi.c:151:32: warning: unused variable ‘xp’ [-Wunused-variable]
    151 |     uint h, w, xs, ys, xe, ye, xp, cc; siz j, m;
        |                                ^~
  ./common/maskApi.c: In function ‘rleFrPoly’:
  ./common/maskApi.c:197:3: warning: this ‘for’ clause does not guard... [-Wmisleading-indentation]
    197 |   for(j=0; j<k; j++) x[j]=(int)(scale*xy[j*2+0]+.5); x[k]=x[0];
        |   ^~~
  ./common/maskApi.c:197:54: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the ‘for’
    197 |   for(j=0; j<k; j++) x[j]=(int)(scale*xy[j*2+0]+.5); x[k]=x[0];
        |                                                      ^
  ./common/maskApi.c:198:3: warning: this ‘for’ clause does not guard... [-Wmisleading-indentation]
    198 |   for(j=0; j<k; j++) y[j]=(int)(scale*xy[j*2+1]+.5); y[k]=y[0];
        |   ^~~
  ./common/maskApi.c:198:54: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the ‘for’
    198 |   for(j=0; j<k; j++) y[j]=(int)(scale*xy[j*2+1]+.5); y[k]=y[0];
        |                                                      ^
  ./common/maskApi.c: In function ‘rleToString’:
  ./common/maskApi.c:243:7: warning: this ‘if’ clause does not guard... [-Wmisleading-indentation]
    243 |       if(more) c |= 0x20; c+=48; s[p++]=c;
        |       ^~
  ./common/maskApi.c:243:27: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the ‘if’
    243 |       if(more) c |= 0x20; c+=48; s[p++]=c;
        |                           ^
  ./common/maskApi.c: In function ‘rleFrString’:
  ./common/maskApi.c:251:3: warning: this ‘while’ clause does not guard... [-Wmisleading-indentation]
    251 |   while( s[m] ) m++; cnts=malloc(sizeof(uint)*m); m=0;
        |   ^~~~~
  ./common/maskApi.c:251:22: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the ‘while’
    251 |   while( s[m] ) m++; cnts=malloc(sizeof(uint)*m); m=0;
        |                      ^~~~
  ./common/maskApi.c:259:5: warning: this ‘if’ clause does not guard... [-Wmisleading-indentation]
    259 |     if(m>2) x+=(long) cnts[m-2]; cnts[m++]=(uint) x;
        |     ^~
  ./common/maskApi.c:259:34: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the ‘if’
    259 |     if(m>2) x+=(long) cnts[m-2]; cnts[m++]=(uint) x;
        |                                  ^~~~
  x86_64-linux-gnu-gcc -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O2 -Wall -g -fstack-protector-strong -Wformat -Werror=format-security -g -fwrapv -O2 -fPIC -I/tmp/pip-build-env-xkmgfc0t/overlay/lib/python3.8/site-packages/numpy/core/include -I./common -I/usr/include/python3.8 -c pycocotools/_mask.c -o build/temp.linux-x86_64-cpython-38/pycocotools/_mask.o -Wno-cpp -Wno-unused-function -std=c99
  pycocotools/_mask.c:6:10: fatal error: Python.h: No such file or directory
      6 | #include "Python.h"
        |          ^~~~~~~~~~
  compilation terminated.
  /tmp/pip-build-env-xkmgfc0t/overlay/lib/python3.8/site-packages/setuptools/dist.py:745: SetuptoolsDeprecationWarning: Invalid dash-separated options
  !!
  
          ********************************************************************************
          Usage of dash-separated 'index-url' will not be supported in future
          versions. Please use the underscore name 'index_url' instead.
  
          By 2023-Sep-26, you need to update your project and remove deprecated calls
          or your builds will no longer be supported.
  
          See https://setuptools.pypa.io/en/latest/userguide/declarative_config.html for details.
          ********************************************************************************
  
  !!
    opt = self.warn_dash_deprecation(opt, section)
  /tmp/pip-build-env-xkmgfc0t/overlay/lib/python3.8/site-packages/Cython/Compiler/Main.py:369: FutureWarning: Cython directive 'language_level' not set, using 2 for now (Py2). This will change in a later release! File: /tmp/pip-install-x0mg8qpf/pycocotools/pycocotools/_mask.pyx
    tree = Parsing.p_module(s, pxd, full_module_name)
  error: command '/usr/bin/x86_64-linux-gnu-gcc' failed with exit code 1
  ----------------------------------------
  ERROR: Failed building wheel for pycocotools
Failed to build pycocotools
ERROR: Could not build wheels for pycocotools which use PEP 517 and cannot be installed directly

细读报错,我们会发现是编译过程中少了一个Python.h 的头文件导致编译pycocotools失败。

我们尝试直接安装pycocotools

pip install pycocotools

会出现和上面一样的错误。

google一番,提示说sudo apt-get install libsuitesparse-dev

受到报错

 Building wheel for pycocotools (pyproject.toml) ... error
  error: subprocess-exited-with-error
  
  × Building wheel for pycocotools (pyproject.toml) did not run successfully.
  │ exit code: 1
  ╰─> [77 lines of output]

最后的结果依然是

  note: This error originates from a subprocess, and is likely not a problem with pip.
  ERROR: Failed building wheel for pycocotools
Failed to build pycocotools
ERROR: Could not build wheels for pycocotools, which is required to install pyproject.toml-based projects

尝试通过安装pip install "git+https://github.com/philferriere/cocoapi.git#egg=pycocotools&subdirectory=PythonAPI" 解决

获得报错

fatal: unable to access 'https://github.com/philferriere/cocoapi.git/': GnuTLS recv error (-110): The TLS connection was non-properly terminated.
  error: subprocess-exited-with-error
  
  × git clone --filter=blob:none --quiet https://github.com/philferriere/cocoapi.git /tmp/pip-install-a4vtujvc/pycocotools_f76f853260a94fd79f5ac4cef5f3a557 did not run successfully.
  │ exit code: 128
  ╰─> See above for output.
  
  note: This error originates from a subprocess, and is likely not a problem with pip.
error: subprocess-exited-with-error

× git clone --filter=blob:none --quiet https://github.com/philferriere/cocoapi.git /tmp/pip-install-a4vtujvc/pycocotools_f76f853260a94fd79f5ac4cef5f3a557 did not run successfully.
│ exit code: 128
╰─> See above for output.

运行sudo apt install python3.8-dev

然后git clone https://github.com/cocodataset/cocoapi.git , cd ./cocoapi/PythonAPI ,接下来 make

运行pip install -e . ,成功安装pycocotools .

再次运行pip install GroundingDINO , 成功。

image.png

标签:x86,linux,报错,build,pycocotools,pip,64,GroundingDINO,安装
From: https://www.cnblogs.com/studyinglover/p/17857226.html

相关文章

  • 用VMware Workstation安装openEuler配置opengauss并连接Django 详细教程
    1.下载准备openEuler22.03LTSSP2下载链接:openEuler下载|欧拉系统ISO镜像|openEuler社区官网下载第一个就可以了,之后配置的时候直接勾选上opengauss,不用下载第二个的(太大了)VMwareWorkstation17Player下载链接:https://www.vmware.com/products/workstation-player/workstat......
  • SQL Server使用Windows身份验证模式安装后,重新设置SA密码
    首次安装SQLServer使用Windows身份验证模式安装后,要重新设置自带用户SA的密码(1)右键数据库--》属性(2)安全性-->勾选“SQLserver和Windows身份认证模式(S)”(3)数据库下“安全性”-->“登录名”-->“sa”-->"属性"(4)直接输入需要设置的密码(5)给sa用户设置权限,在“服务器角色”设置为public......
  • 如何在windows系统下安装适用于linux的windows子系统
    最近部分工作需要在linux系统下操作,想着在自己本本上安装个虚拟机,废了九牛二虎之力安装好了VMware及Ubuntu系统,但是其在主机和虚拟机间共享数据不是很方便。于是又废了半天劲安装了VMwaretools,设置了共享盘、并启动后自动挂载。一切搞定后,无意中发现windows下可以安装linux子系统......
  • X86 安装 ARM虚拟机
    WIN10x86环境部署ARM虚拟机(银河麒麟)实例目录WIN10x86环境部署ARM虚拟机(银河麒麟)实例前言部署前的准备安装安装虚拟机启动虚拟机利用shell工具连接前言在我们日常的生产以及运维中,我们经常使用到不同架构的服务器,我们经常使用的是x86架构的cpu,这样一来我们对于同样是x86架构的64......
  • Ubuntu22.04 图形化安装 Eclipse
    由于云计算大数据课程需要,在此记录下我的安装过程点击打开Ubuntu左侧边栏自带的软件中心搜索elipse点击安装,应该会弹出认证窗口,输入当前用户的登录密码即可等待安装结束后,点击Ubuntu左侧边栏的搜索工具,搜索并打开Eclipse第一次打开需要选择工作空间,来保......
  • Debian12安装必要的设置
    允许root远程登录(可选)https://www.cnblogs.com/tothk/p/16441361.html配置镜像源https://www.cnblogs.com/tothk/p/16298181.html修改系统时区https://www.cnblogs.com/tothk/p/16368444.html最后编辑时间:2023年11月26日10:43:43......
  • 如何安装排版插件?
    如何安装排版插件?用专门的压缩包,解压缩出来几个文件在《原版程序》文件夹中点:setup.exe,完成安装安装中会提示没有GMS文件,不用管它,我们用的是破解精简版选版本,选英语,选地址这一步主要是完成破解版的安装将《汉化文件》中的LangR5,复制到*:\eCut\ini的文件夹内,替换之......
  • CDRx4,如何安装ecat排版软件?
    1.先安装原版文件夹中的setup.exe进行安装,选择对应的coreldraw版本号2.将汉化文件夹中的LangR5替换复制粘贴到C:\eCut\ini 的文件夹内。替换之前的英文文件3.导入中文工作区(gms插件文复制到\CorelDRAWX4SP2\Draw\GMS目录下      xslt为工作......
  • 使用 NSIS 将 Python 程序制作成 Windows 环境下的安装程序(安装包)
    转载于:https://www.freesion.com/article/1583987771/#1_NSIS__6NSIS官网下载:https://nsis.sourceforge.io/Main_Page首先,需要使用PythonPyInstaller模块将Python程序制作成可直接运行的EXE程序。(可以不要-F参数)将我们所需的、打包好的windowdemo目录(文件夹)压索成.zip......
  • Day03 JavaSE介绍与安装卸载
    1.Java三大版本javaSE:标准版(桌面程序,控制台程序开发)JavaME:精简版(嵌入式开发)javaEE:企业级开发(web开发,服务器开发)2.JDK、JRE、JVMJDK:javadevelopmentkitJRE:javaruntimeenvirnmentJVM:javavirtualmachine其中JDK包含了JRE与JVM。JRE包含了JVM。安装了JRE后......