기본 Python 3(Anaconda Python 아님)용 CentOS 7에 OpenDR 설치

기본 Python 3(Anaconda Python 아님)용 CentOS 7에 OpenDR 설치

다음 명령이 작동하지 않았습니다. 문제를 해결하는 방법을 안내해 주시겠습니까?

$ pip install opendr
Collecting opendr
  Downloading opendr-0.78.tar.gz (581 kB)
     |████████████████████████████████| 581 kB 1.3 MB/s 
Requirement already satisfied: Cython in /scratch3/venv/frank/lib/python3.8/site-packages (from opendr) (0.29.22)
Requirement already satisfied: chumpy>=0.58 in /scratch3/venv/frank/lib/python3.8/site-packages (from opendr) (0.70)
Requirement already satisfied: matplotlib in /scratch3/venv/frank/lib/python3.8/site-packages (from opendr) (3.4.0)
Requirement already satisfied: scipy>=0.13.0 in /scratch3/venv/frank/lib/python3.8/site-packages (from chumpy>=0.58->opendr) (1.6.2)
Requirement already satisfied: six>=1.11.0 in /scratch3/venv/frank/lib/python3.8/site-packages (from chumpy>=0.58->opendr) (1.15.0)
Requirement already satisfied: numpy<1.23.0,>=1.16.5 in /scratch3/venv/frank/lib/python3.8/site-packages (from scipy>=0.13.0->chumpy>=0.58->opendr) (1.20.2)
Requirement already satisfied: kiwisolver>=1.0.1 in /scratch3/venv/frank/lib/python3.8/site-packages (from matplotlib->opendr) (1.3.1)
Requirement already satisfied: pyparsing>=2.2.1 in /scratch3/venv/frank/lib/python3.8/site-packages (from matplotlib->opendr) (2.4.7)
Requirement already satisfied: python-dateutil>=2.7 in /scratch3/venv/frank/lib/python3.8/site-packages (from matplotlib->opendr) (2.8.1)
Requirement already satisfied: cycler>=0.10 in /scratch3/venv/frank/lib/python3.8/site-packages (from matplotlib->opendr) (0.10.0)
Requirement already satisfied: pillow>=6.2.0 in /scratch3/venv/frank/lib/python3.8/site-packages (from matplotlib->opendr) (8.1.2)
Building wheels for collected packages: opendr
  Building wheel for opendr (setup.py) ... error
  ERROR: Command errored out with exit status 1:
   command: /scratch3/venv/frank/bin/python3.8 -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/scratch/tmp/pip-install-2xl2_aae/opendr_cca5ff679db14567af924447cc43444b/setup.py'"'"'; __file__='"'"'/scratch/tmp/pip-install-2xl2_aae/opendr_cca5ff679db14567af924447cc43444b/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' bdist_wheel -d /scratch/tmp/pip-wheel-xb1f2chh
       cwd: /scratch/tmp/pip-install-2xl2_aae/opendr_cca5ff679db14567af924447cc43444b/
  Complete output (65 lines):
  running bdist_wheel
  running build
  running build_py
  creating build
  creating build/lib.linux-x86_64-3.8
  creating build/lib.linux-x86_64-3.8/opendr
  copying opendr/__init__.py -> build/lib.linux-x86_64-3.8/opendr
  copying opendr/camera.py -> build/lib.linux-x86_64-3.8/opendr
  copying opendr/common.py -> build/lib.linux-x86_64-3.8/opendr
  copying opendr/cvwrap.py -> build/lib.linux-x86_64-3.8/opendr
  copying opendr/dummy.py -> build/lib.linux-x86_64-3.8/opendr
  copying opendr/everything.py -> build/lib.linux-x86_64-3.8/opendr
  copying opendr/filters.py -> build/lib.linux-x86_64-3.8/opendr
  copying opendr/geometry.py -> build/lib.linux-x86_64-3.8/opendr
  copying opendr/lighting.py -> build/lib.linux-x86_64-3.8/opendr
  copying opendr/occlusion_test.py -> build/lib.linux-x86_64-3.8/opendr
  copying opendr/renderer.py -> build/lib.linux-x86_64-3.8/opendr
  copying opendr/serialization.py -> build/lib.linux-x86_64-3.8/opendr
  copying opendr/simple.py -> build/lib.linux-x86_64-3.8/opendr
  copying opendr/slider_demo.py -> build/lib.linux-x86_64-3.8/opendr
  copying opendr/test_camera.py -> build/lib.linux-x86_64-3.8/opendr
  copying opendr/test_depth_renderer.py -> build/lib.linux-x86_64-3.8/opendr
  copying opendr/test_geometry.py -> build/lib.linux-x86_64-3.8/opendr
  copying opendr/test_renderer.py -> build/lib.linux-x86_64-3.8/opendr
  copying opendr/test_sh.py -> build/lib.linux-x86_64-3.8/opendr
  copying opendr/topology.py -> build/lib.linux-x86_64-3.8/opendr
  copying opendr/util_tests.py -> build/lib.linux-x86_64-3.8/opendr
  copying opendr/utils.py -> build/lib.linux-x86_64-3.8/opendr
  copying opendr/version.py -> build/lib.linux-x86_64-3.8/opendr
  creating build/lib.linux-x86_64-3.8/opendr/contexts
  copying opendr/contexts/__init__.py -> build/lib.linux-x86_64-3.8/opendr/contexts
  copying opendr/contexts/_constants.py -> build/lib.linux-x86_64-3.8/opendr/contexts
  copying opendr/contexts/autogen.py -> build/lib.linux-x86_64-3.8/opendr/contexts
  copying opendr/contexts/draw_triangle_shaders_2_1.py -> build/lib.linux-x86_64-3.8/opendr/contexts
  copying opendr/contexts/draw_triangle_shaders_3_2.py -> build/lib.linux-x86_64-3.8/opendr/contexts
  copying opendr/contexts/fix_warnings.py -> build/lib.linux-x86_64-3.8/opendr/contexts
  creating build/lib.linux-x86_64-3.8/opendr/test_dr
  copying opendr/test_dr/__init__.py -> build/lib.linux-x86_64-3.8/opendr/test_dr
  running build_ext
  building 'opendr.contexts.ctx_mesa' extension
  creating build/temp.linux-x86_64-3.8
  creating build/temp.linux-x86_64-3.8/opendr
  creating build/temp.linux-x86_64-3.8/opendr/contexts
  gcc -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -fPIC -D__OSMESA__=1 -Iopendr/contexts -I. -I/scratch3/venv/frank/lib/python3.8/site-packages/numpy/core/include -Iopendr/contexts/OSMesa/include -I/scratch3/venv/frank/include -I/usr/local/include/python3.8 -c opendr/contexts/ctx_mesa.c -o build/temp.linux-x86_64-3.8/opendr/contexts/ctx_mesa.o -lstdc++
  In file included from /scratch3/venv/frank/lib/python3.8/site-packages/numpy/core/include/numpy/ndarraytypes.h:1944:0,
                   from /scratch3/venv/frank/lib/python3.8/site-packages/numpy/core/include/numpy/ndarrayobject.h:12,
                   from /scratch3/venv/frank/lib/python3.8/site-packages/numpy/core/include/numpy/arrayobject.h:4,
                   from opendr/contexts/ctx_mesa.c:660:
  /scratch3/venv/frank/lib/python3.8/site-packages/numpy/core/include/numpy/npy_1_7_deprecated_api.h:17:2: warning: #warning "Using deprecated NumPy API, disable it with " "#define NPY_NO_DEPRECATED_API NPY_1_7_API_VERSION" [-Wcpp]
   #warning "Using deprecated NumPy API, disable it with " \
    ^~~~~~~
  opendr/contexts/ctx_mesa.c: In function ‘__pyx_pf_6opendr_8contexts_8ctx_mesa_13OsContextBase_150ShaderSource’:
  opendr/contexts/ctx_mesa.c:13144:49: warning: passing argument 3 of ‘glShaderSource’ from incompatible pointer type [-Wincompatible-pointer-types]
     glShaderSource(__pyx_v_shader, __pyx_v_count, (&__pyx_v_s), (&__pyx_v_len));
                                                   ^
  In file included from opendr/contexts/OSMesa/include/GL/gl.h:2085:0,
                   from opendr/contexts/gl_includes.h:10,
                   from opendr/contexts/ctx_mesa.c:668:
  opendr/contexts/OSMesa/include/GL/glext.h:5794:21: note: expected ‘const GLchar ** {aka const char **}’ but argument is of type ‘char **’
   GLAPI void APIENTRY glShaderSource (GLuint shader, GLsizei count, const GLchar* *string, const GLint *length);
                       ^~~~~~~~~~~~~~
  gcc -pthread -shared build/temp.linux-x86_64-3.8/opendr/contexts/ctx_mesa.o -Lopendr/contexts/OSMesa/lib -lOSMesa -lGL -lGLU -o build/lib.linux-x86_64-3.8/opendr/contexts/ctx_mesa.cpython-38-x86_64-linux-gnu.so -lstdc++
  /usr/bin/ld: cannot find -lOSMesa
  collect2: error: ld returned 1 exit status
  error: command 'gcc' failed with exit status 1
  ----------------------------------------
  ERROR: Failed building wheel for opendr
  Running setup.py clean for opendr
Failed to build opendr
Installing collected packages: opendr
    Running setup.py install for opendr ... error
    ERROR: Command errored out with exit status 1:
     command: /scratch3/venv/frank/bin/python3.8 -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/scratch/tmp/pip-install-2xl2_aae/opendr_cca5ff679db14567af924447cc43444b/setup.py'"'"'; __file__='"'"'/scratch/tmp/pip-install-2xl2_aae/opendr_cca5ff679db14567af924447cc43444b/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record /scratch/tmp/pip-record-q52my77n/install-record.txt --single-version-externally-managed --compile --install-headers /scratch3/venv/frank/include/site/python3.8/opendr
         cwd: /scratch/tmp/pip-install-2xl2_aae/opendr_cca5ff679db14567af924447cc43444b/
    Complete output (65 lines):
    running install
    running build
    running build_py
    creating build
    creating build/lib.linux-x86_64-3.8
    creating build/lib.linux-x86_64-3.8/opendr
    copying opendr/__init__.py -> build/lib.linux-x86_64-3.8/opendr
    copying opendr/camera.py -> build/lib.linux-x86_64-3.8/opendr
    copying opendr/common.py -> build/lib.linux-x86_64-3.8/opendr
    copying opendr/cvwrap.py -> build/lib.linux-x86_64-3.8/opendr
    copying opendr/dummy.py -> build/lib.linux-x86_64-3.8/opendr
    copying opendr/everything.py -> build/lib.linux-x86_64-3.8/opendr
    copying opendr/filters.py -> build/lib.linux-x86_64-3.8/opendr
    copying opendr/geometry.py -> build/lib.linux-x86_64-3.8/opendr
    copying opendr/lighting.py -> build/lib.linux-x86_64-3.8/opendr
    copying opendr/occlusion_test.py -> build/lib.linux-x86_64-3.8/opendr
    copying opendr/renderer.py -> build/lib.linux-x86_64-3.8/opendr
    copying opendr/serialization.py -> build/lib.linux-x86_64-3.8/opendr
    copying opendr/simple.py -> build/lib.linux-x86_64-3.8/opendr
    copying opendr/slider_demo.py -> build/lib.linux-x86_64-3.8/opendr
    copying opendr/test_camera.py -> build/lib.linux-x86_64-3.8/opendr
    copying opendr/test_depth_renderer.py -> build/lib.linux-x86_64-3.8/opendr
    copying opendr/test_geometry.py -> build/lib.linux-x86_64-3.8/opendr
    copying opendr/test_renderer.py -> build/lib.linux-x86_64-3.8/opendr
    copying opendr/test_sh.py -> build/lib.linux-x86_64-3.8/opendr
    copying opendr/topology.py -> build/lib.linux-x86_64-3.8/opendr
    copying opendr/util_tests.py -> build/lib.linux-x86_64-3.8/opendr
    copying opendr/utils.py -> build/lib.linux-x86_64-3.8/opendr
    copying opendr/version.py -> build/lib.linux-x86_64-3.8/opendr
    creating build/lib.linux-x86_64-3.8/opendr/contexts
    copying opendr/contexts/__init__.py -> build/lib.linux-x86_64-3.8/opendr/contexts
    copying opendr/contexts/_constants.py -> build/lib.linux-x86_64-3.8/opendr/contexts
    copying opendr/contexts/autogen.py -> build/lib.linux-x86_64-3.8/opendr/contexts
    copying opendr/contexts/draw_triangle_shaders_2_1.py -> build/lib.linux-x86_64-3.8/opendr/contexts
    copying opendr/contexts/draw_triangle_shaders_3_2.py -> build/lib.linux-x86_64-3.8/opendr/contexts
    copying opendr/contexts/fix_warnings.py -> build/lib.linux-x86_64-3.8/opendr/contexts
    creating build/lib.linux-x86_64-3.8/opendr/test_dr
    copying opendr/test_dr/__init__.py -> build/lib.linux-x86_64-3.8/opendr/test_dr
    running build_ext
    building 'opendr.contexts.ctx_mesa' extension
    creating build/temp.linux-x86_64-3.8
    creating build/temp.linux-x86_64-3.8/opendr
    creating build/temp.linux-x86_64-3.8/opendr/contexts
    gcc -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -fPIC -D__OSMESA__=1 -Iopendr/contexts -I. -I/scratch3/venv/frank/lib/python3.8/site-packages/numpy/core/include -Iopendr/contexts/OSMesa/include -I/scratch3/venv/frank/include -I/usr/local/include/python3.8 -c opendr/contexts/ctx_mesa.c -o build/temp.linux-x86_64-3.8/opendr/contexts/ctx_mesa.o -lstdc++
    In file included from /scratch3/venv/frank/lib/python3.8/site-packages/numpy/core/include/numpy/ndarraytypes.h:1944:0,
                     from /scratch3/venv/frank/lib/python3.8/site-packages/numpy/core/include/numpy/ndarrayobject.h:12,
                     from /scratch3/venv/frank/lib/python3.8/site-packages/numpy/core/include/numpy/arrayobject.h:4,
                     from opendr/contexts/ctx_mesa.c:660:
    /scratch3/venv/frank/lib/python3.8/site-packages/numpy/core/include/numpy/npy_1_7_deprecated_api.h:17:2: warning: #warning "Using deprecated NumPy API, disable it with " "#define NPY_NO_DEPRECATED_API NPY_1_7_API_VERSION" [-Wcpp]
     #warning "Using deprecated NumPy API, disable it with " \
      ^~~~~~~
    opendr/contexts/ctx_mesa.c: In function ‘__pyx_pf_6opendr_8contexts_8ctx_mesa_13OsContextBase_150ShaderSource’:
    opendr/contexts/ctx_mesa.c:13144:49: warning: passing argument 3 of ‘glShaderSource’ from incompatible pointer type [-Wincompatible-pointer-types]
       glShaderSource(__pyx_v_shader, __pyx_v_count, (&__pyx_v_s), (&__pyx_v_len));
                                                     ^
    In file included from opendr/contexts/OSMesa/include/GL/gl.h:2085:0,
                     from opendr/contexts/gl_includes.h:10,
                     from opendr/contexts/ctx_mesa.c:668:
    opendr/contexts/OSMesa/include/GL/glext.h:5794:21: note: expected ‘const GLchar ** {aka const char **}’ but argument is of type ‘char **’
     GLAPI void APIENTRY glShaderSource (GLuint shader, GLsizei count, const GLchar* *string, const GLint *length);
                         ^~~~~~~~~~~~~~
    gcc -pthread -shared build/temp.linux-x86_64-3.8/opendr/contexts/ctx_mesa.o -Lopendr/contexts/OSMesa/lib -lOSMesa -lGL -lGLU -o build/lib.linux-x86_64-3.8/opendr/contexts/ctx_mesa.cpython-38-x86_64-linux-gnu.so -lstdc++
    /usr/bin/ld: cannot find -lOSMesa
    collect2: error: ld returned 1 exit status
    error: command 'gcc' failed with exit status 1
    ----------------------------------------
ERROR: Command errored out with exit status 1: /scratch3/venv/frank/bin/python3.8 -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/scratch/tmp/pip-install-2xl2_aae/opendr_cca5ff679db14567af924447cc43444b/setup.py'"'"'; __file__='"'"'/scratch/tmp/pip-install-2xl2_aae/opendr_cca5ff679db14567af924447cc43444b/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record /scratch/tmp/pip-record-q52my77n/install-record.txt --single-version-externally-managed --compile --install-headers /scratch3/venv/frank/include/site/python3.8/opendr Check the logs for full command output.

나는 가지고있다:

$ python
Python 3.8.5 (default, Mar 31 2021, 02:37:07) 
[GCC 7.3.1 20180303 (Red Hat 7.3.1-5)] on linux

그리고

$ lsb_release -a
LSB Version:    :core-4.1-amd64:core-4.1-noarch
Distributor ID: CentOS
Description:    CentOS Linux release 7.9.2009 (Core)
Release:    7.9.2009
Codename:   Core


답변1

현재,PyPI에 나열된 최신 버전의 opendr( pip파일을 가져오는 위치)는 버전 0.78입니다. 이 버전에서는 Python 3을 사용하는 동안 Python 2만 지원된다고 나열합니다. opendr을 설치하는 가장 직접적인 방법은 Python 2.7을 사용하여 Python 가상 환경을 만들고 해당 환경에 opendr을 설치하는 것입니다(다른 잠재적인 문제는 제쳐두고). .

Python 3용 opendr을 설치해야 합니다.

그렇다면 Google에서 'opendr 파이썬 3". 그러면 다음과 같은 결과가 반환됩니다.이 GitHub 문제그리고이 GitHub 문제주제를 토론하는 것입니다. 간단히 말해서, 일부 추가 소프트웨어 패키지(CentOS는 직접 논의되지 않음)와 함께 opendr을 설치하는 방법이 하나 이상 있는 것으로 보이며, 다른 옵션은 프로젝트의 포크를 설치하는 것입니다.

나열된 포크(Python 3)


사소한 점은 OSMesa API가 걸림돌이 될 수 있다는 것입니다. 위의 두 GitHub 문제에서 간접적으로 참조됩니다.이 스택 오버플로 질문그리고 당신 자신의 오류 출력.

관련 정보