我正在使用python2.7并创建了一个虚拟环境’kivyenv’.
首先我安装Cython然后kivy在kivyenv.
pip install Cython
pip install kivy
kivy未能安装给出一些错误: –
In file included from /tmp/pip-build-4T9oG4/kivy/kivy/graphics/opengl.c:274:0:
/tmp/pip-build-4T9oG4/kivy/kivy/graphics/gl_redirect.h:43:22: fatal error: GL/gl.h: No such file or directory
# include
^
compilation terminated.
error: command 'x86_64-linux-gnu-gcc' failed with exit status 1
----------------------------------------
Command "/root/kivyenv/bin/python2.7 -u -c "import setuptools, tokenize;__file__='/tmp/pip-build-4T9oG4/kivy/setup.py';
exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))"
install --record /tmp/pip-3__DxE-record/install-record.txt --single-version-externally-managed --compile --install-headers
/root/kivyenv/include/site/python2.7/kivy" failed with error code 1 in /tmp/pip-build-4T9oG4/kivy/
我正在使用Ubuntu 16.
解决方法:
发生这种情况是因为您的系统上没有安装依赖库,特别是OpenGL的依赖库 – 很可能您没有安装mesa软件包.
标签:kivy,python,linux,python-2-7,virtualenv
来源: https://codeday.me/bug/20190828/1755635.html