Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to install OpenDR #8

Closed
zczcwh opened this issue Jun 4, 2021 · 6 comments
Closed

Unable to install OpenDR #8

zczcwh opened this issue Jun 4, 2021 · 6 comments

Comments

@zczcwh
Copy link

zczcwh commented Jun 4, 2021

Hi, thanks for your great work. When I install OpenDR, here is the error. Do you know how to solve this?

(metro) cezheng@lambda-dual:~/HPE/meshpose/MeshTransformer/apex$ pip install opendr matplotlib
Collecting opendr
Using cached opendr-0.78.tar.gz (581 kB)
Requirement already satisfied: matplotlib in /home/cezheng/anaconda3/envs/metro/lib/python3.8/site-packages (3.3.2)
Requirement already satisfied: Cython in /home/cezheng/anaconda3/envs/metro/lib/python3.8/site-packages (from opendr) (0.29.21)
Requirement already satisfied: chumpy>=0.58 in /home/cezheng/anaconda3/envs/metro/lib/python3.8/site-packages (from opendr) (0.69)
Requirement already satisfied: pillow>=6.2.0 in /home/cezheng/anaconda3/envs/metro/lib/python3.8/site-packages (from matplotlib) (7.2.0)
Requirement already satisfied: kiwisolver>=1.0.1 in /home/cezheng/anaconda3/envs/metro/lib/python3.8/site-packages (from matplotlib) (1.2.0)
Requirement already satisfied: pyparsing!=2.0.4,!=2.1.2,!=2.1.6,>=2.0.3 in /home/cezheng/anaconda3/envs/metro/lib/python3.8/site-packages (from matplotlib) (2.4.7)
Requirement already satisfied: numpy>=1.15 in /home/cezheng/anaconda3/envs/metro/lib/python3.8/site-packages (from matplotlib) (1.19.2)
Requirement already satisfied: certifi>=2020.06.20 in /home/cezheng/anaconda3/envs/metro/lib/python3.8/site-packages (from matplotlib) (2021.5.30)
Requirement already satisfied: python-dateutil>=2.1 in /home/cezheng/anaconda3/envs/metro/lib/python3.8/site-packages (from matplotlib) (2.8.1)
Requirement already satisfied: cycler>=0.10 in /home/cezheng/anaconda3/envs/metro/lib/python3.8/site-packages (from matplotlib) (0.10.0)
Requirement already satisfied: scipy>=0.13.0 in /home/cezheng/anaconda3/envs/metro/lib/python3.8/site-packages (from chumpy>=0.58->opendr) (1.6.2)
Requirement already satisfied: six>=1.11.0 in /home/cezheng/anaconda3/envs/metro/lib/python3.8/site-packages (from chumpy>=0.58->opendr) (1.15.0)
Building wheels for collected packages: opendr
Building wheel for opendr (setup.py) ... error
ERROR: Command errored out with exit status 1:
command: /home/cezheng/anaconda3/envs/metro/bin/python -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-kws8g40y/opendr/setup.py'"'"'; file='"'"'/tmp/pip-install-kws8g40y/opendr/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 /tmp/pip-wheel-j7sa3lsx
cwd: /tmp/pip-install-kws8g40y/opendr/
Complete output (72 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/test_depth_renderer.py -> build/lib.linux-x86_64-3.8/opendr
copying opendr/occlusion_test.py -> build/lib.linux-x86_64-3.8/opendr
copying opendr/topology.py -> build/lib.linux-x86_64-3.8/opendr
copying opendr/lighting.py -> build/lib.linux-x86_64-3.8/opendr
copying opendr/everything.py -> build/lib.linux-x86_64-3.8/opendr
copying opendr/utils.py -> build/lib.linux-x86_64-3.8/opendr
copying opendr/dummy.py -> build/lib.linux-x86_64-3.8/opendr
copying opendr/version.py -> build/lib.linux-x86_64-3.8/opendr
copying opendr/camera.py -> build/lib.linux-x86_64-3.8/opendr
copying opendr/init.py -> build/lib.linux-x86_64-3.8/opendr
copying opendr/simple.py -> build/lib.linux-x86_64-3.8/opendr
copying opendr/test_renderer.py -> build/lib.linux-x86_64-3.8/opendr
copying opendr/util_tests.py -> build/lib.linux-x86_64-3.8/opendr
copying opendr/serialization.py -> build/lib.linux-x86_64-3.8/opendr
copying opendr/test_sh.py -> build/lib.linux-x86_64-3.8/opendr
copying opendr/slider_demo.py -> build/lib.linux-x86_64-3.8/opendr
copying opendr/geometry.py -> build/lib.linux-x86_64-3.8/opendr
copying opendr/filters.py -> build/lib.linux-x86_64-3.8/opendr
copying opendr/cvwrap.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_camera.py -> build/lib.linux-x86_64-3.8/opendr
copying opendr/common.py -> build/lib.linux-x86_64-3.8/opendr
copying opendr/renderer.py -> build/lib.linux-x86_64-3.8/opendr
creating 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/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/fix_warnings.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
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 -B /home/cezheng/anaconda3/envs/metro/compiler_compat -Wl,--sysroot=/ -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -fPIC -D__OSMESA
_=1 -Iopendr/contexts -I. -I/home/cezheng/anaconda3/envs/metro/lib/python3.8/site-packages/numpy/core/include -Iopendr/contexts/OSMesa/include -I/home/cezheng/anaconda3/envs/metro/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 /home/cezheng/anaconda3/envs/metro/lib/python3.8/site-packages/numpy/core/include/numpy/ndarraytypes.h:1822,
from /home/cezheng/anaconda3/envs/metro/lib/python3.8/site-packages/numpy/core/include/numpy/ndarrayobject.h:12,
from /home/cezheng/anaconda3/envs/metro/lib/python3.8/site-packages/numpy/core/include/numpy/arrayobject.h:4,
from opendr/contexts/ctx_mesa.c:657:
/home/cezheng/anaconda3/envs/metro/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]
17 | #warning "Using deprecated NumPy API, disable it with "
| ^~~~~~~
In file included from opendr/contexts/ctx_mesa.c:663:
opendr/contexts/OSMesa/include/GL/osmesa.h:258:1: warning: function declaration isn’t a prototype [-Wstrict-prototypes]
258 | typedef void (*OSMESAproc)();
| ^~~~~~~
opendr/contexts/ctx_mesa.c: In function ‘__pyx_pf_6opendr_8contexts_8ctx_mesa_13OsContextBase_150ShaderSource’:
opendr/contexts/ctx_mesa.c:13123:50: warning: passing argument 3 of ‘glShaderSource’ from incompatible pointer type [-Wincompatible-pointer-types]
13123 | glShaderSource(__pyx_v_shader, __pyx_v_count, (&__pyx_v_s), (&__pyx_v_len));
| ~^~~~~~~~~~~
| |
| char **
In file included from opendr/contexts/OSMesa/include/GL/gl.h:2085,
from opendr/contexts/gl_includes.h:10,
from opendr/contexts/ctx_mesa.c:662:
opendr/contexts/OSMesa/include/GL/glext.h:5794:82: note: expected ‘const GLchar **’ {aka ‘const char **’} but argument is of type ‘char *
5794 | GLAPI void APIENTRY glShaderSource (GLuint shader, GLsizei count, const GLchar
*string, const GLint *length);
| ~~~~~~~~~~~~~~~^~~~~~
gcc -pthread -shared -B /home/cezheng/anaconda3/envs/metro/compiler_compat -L/home/cezheng/anaconda3/envs/metro/lib -Wl,-rpath=/home/cezheng/anaconda3/envs/metro/lib -Wl,--no-as-needed -Wl,--sysroot=/ 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++
/home/cezheng/anaconda3/envs/metro/compiler_compat/ld: cannot find -lOSMesa
/home/cezheng/anaconda3/envs/metro/compiler_compat/ld: cannot find -lGLU
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
DEPRECATION: Could not build wheels for opendr which do not use PEP 517. pip will fall back to legacy 'setup.py install' for these. pip 21.0 will remove support for this functionality. A possible replacement is to fix the wheel build issue reported above. You can find discussion regarding this at pypa/pip#8368.
Installing collected packages: opendr
Running setup.py install for opendr ... error
ERROR: Command errored out with exit status 1:
command: /home/cezheng/anaconda3/envs/metro/bin/python -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-kws8g40y/opendr/setup.py'"'"'; file='"'"'/tmp/pip-install-kws8g40y/opendr/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(file);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, file, '"'"'exec'"'"'))' install --record /tmp/pip-record-2a0woggk/install-record.txt --single-version-externally-managed --compile --install-headers /home/cezheng/anaconda3/envs/metro/include/python3.8/opendr
cwd: /tmp/pip-install-kws8g40y/opendr/
Complete output (72 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/test_depth_renderer.py -> build/lib.linux-x86_64-3.8/opendr
copying opendr/occlusion_test.py -> build/lib.linux-x86_64-3.8/opendr
copying opendr/topology.py -> build/lib.linux-x86_64-3.8/opendr
copying opendr/lighting.py -> build/lib.linux-x86_64-3.8/opendr
copying opendr/everything.py -> build/lib.linux-x86_64-3.8/opendr
copying opendr/utils.py -> build/lib.linux-x86_64-3.8/opendr
copying opendr/dummy.py -> build/lib.linux-x86_64-3.8/opendr
copying opendr/version.py -> build/lib.linux-x86_64-3.8/opendr
copying opendr/camera.py -> build/lib.linux-x86_64-3.8/opendr
copying opendr/init.py -> build/lib.linux-x86_64-3.8/opendr
copying opendr/simple.py -> build/lib.linux-x86_64-3.8/opendr
copying opendr/test_renderer.py -> build/lib.linux-x86_64-3.8/opendr
copying opendr/util_tests.py -> build/lib.linux-x86_64-3.8/opendr
copying opendr/serialization.py -> build/lib.linux-x86_64-3.8/opendr
copying opendr/test_sh.py -> build/lib.linux-x86_64-3.8/opendr
copying opendr/slider_demo.py -> build/lib.linux-x86_64-3.8/opendr
copying opendr/geometry.py -> build/lib.linux-x86_64-3.8/opendr
copying opendr/filters.py -> build/lib.linux-x86_64-3.8/opendr
copying opendr/cvwrap.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_camera.py -> build/lib.linux-x86_64-3.8/opendr
copying opendr/common.py -> build/lib.linux-x86_64-3.8/opendr
copying opendr/renderer.py -> build/lib.linux-x86_64-3.8/opendr
creating 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/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/fix_warnings.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
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 -B /home/cezheng/anaconda3/envs/metro/compiler_compat -Wl,--sysroot=/ -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -fPIC -D__OSMESA
_=1 -Iopendr/contexts -I. -I/home/cezheng/anaconda3/envs/metro/lib/python3.8/site-packages/numpy/core/include -Iopendr/contexts/OSMesa/include -I/home/cezheng/anaconda3/envs/metro/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 /home/cezheng/anaconda3/envs/metro/lib/python3.8/site-packages/numpy/core/include/numpy/ndarraytypes.h:1822,
from /home/cezheng/anaconda3/envs/metro/lib/python3.8/site-packages/numpy/core/include/numpy/ndarrayobject.h:12,
from /home/cezheng/anaconda3/envs/metro/lib/python3.8/site-packages/numpy/core/include/numpy/arrayobject.h:4,
from opendr/contexts/ctx_mesa.c:657:
/home/cezheng/anaconda3/envs/metro/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]
17 | #warning "Using deprecated NumPy API, disable it with "
| ^~~~~~~
In file included from opendr/contexts/ctx_mesa.c:663:
opendr/contexts/OSMesa/include/GL/osmesa.h:258:1: warning: function declaration isn’t a prototype [-Wstrict-prototypes]
258 | typedef void (*OSMESAproc)();
| ^~~~~~~
opendr/contexts/ctx_mesa.c: In function ‘__pyx_pf_6opendr_8contexts_8ctx_mesa_13OsContextBase_150ShaderSource’:
opendr/contexts/ctx_mesa.c:13123:50: warning: passing argument 3 of ‘glShaderSource’ from incompatible pointer type [-Wincompatible-pointer-types]
13123 | glShaderSource(__pyx_v_shader, __pyx_v_count, (&__pyx_v_s), (&__pyx_v_len));
| ~^~~~~~~~~~~
| |
| char **
In file included from opendr/contexts/OSMesa/include/GL/gl.h:2085,
from opendr/contexts/gl_includes.h:10,
from opendr/contexts/ctx_mesa.c:662:
opendr/contexts/OSMesa/include/GL/glext.h:5794:82: note: expected ‘const GLchar **’ {aka ‘const char **’} but argument is of type ‘char *
5794 | GLAPI void APIENTRY glShaderSource (GLuint shader, GLsizei count, const GLchar
*string, const GLint *length);
| ~~~~~~~~~~~~~~~^~~~~~
gcc -pthread -shared -B /home/cezheng/anaconda3/envs/metro/compiler_compat -L/home/cezheng/anaconda3/envs/metro/lib -Wl,-rpath=/home/cezheng/anaconda3/envs/metro/lib -Wl,--no-as-needed -Wl,--sysroot=/ 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++
/home/cezheng/anaconda3/envs/metro/compiler_compat/ld: cannot find -lOSMesa
/home/cezheng/anaconda3/envs/metro/compiler_compat/ld: cannot find -lGLU
collect2: error: ld returned 1 exit status
error: command 'gcc' failed with exit status 1
----------------------------------------
ERROR: Command errored out with exit status 1: /home/cezheng/anaconda3/envs/metro/bin/python -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-kws8g40y/opendr/setup.py'"'"'; file='"'"'/tmp/pip-install-kws8g40y/opendr/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(file);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, file, '"'"'exec'"'"'))' install --record /tmp/pip-record-2a0woggk/install-record.txt --single-version-externally-managed --compile --install-headers /home/cezheng/anaconda3/envs/metro/include/python3.8/opendr Check the logs for full command output.

@boza-wd
Copy link

boza-wd commented Jun 4, 2021

Try:
pip install git+https://gitlab.eecs.umich.edu/ngv-python-modules/opendr.git

Cheers

@kevinlin311tw
Copy link
Member

Another possible way:

apt-get update
apt-get install  build-essential libgl1-mesa-dev  libglu1-mesa-dev freeglut3-dev 
apt-get install libosmesa6-dev
pip install opendr

@zczcwh
Copy link
Author

zczcwh commented Jun 5, 2021

Try:
pip install git+https://gitlab.eecs.umich.edu/ngv-python-modules/opendr.git

Cheers

Thank you very much, it works!

@RiaBawiskar
Copy link

Another possible way:

apt-get update
apt-get install  build-essential libgl1-mesa-dev  libglu1-mesa-dev freeglut3-dev 
apt-get install libosmesa6-dev
pip install opendr

thank you so much! this worked for me

@Su-yukun
Copy link

Another possible way:

apt-get update
apt-get install  build-essential libgl1-mesa-dev  libglu1-mesa-dev freeglut3-dev 
apt-get install libosmesa6-dev
pip install opendr

thanks

@SURYAMurugan2211
Copy link

note: This error originates from a subprocess, and is likely not a problem with pip.
error: metadata-generation-failed

× Encountered error while generating package metadata.
╰─> See above for output.

note: This is an issue with the package mentioned above, not pip.
hint: See above for details.
I can run the pip install git+https://gitlab.eecs.umich.edu/ngv-python-modules/opendr.git in vs code terminal it will show the above error what can i do

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants