Linux : unable to install kivy in virtual environment
<p>I am using python2.7 and created a virtual environment 'kivyenv'.
First i install Cython and then kivy in kivyenv.</p>

<pre><code>pip install Cython
pip install kivy
</code></pre>

<p>kivy failed to install giving some error :-</p>

<pre><code>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 &lt;GL/gl.h&gt;
                      ^
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/
</code></pre>

<p>I am using Ubuntu 16.</p>

<p>This is happening because you do not have dependency libraries installed on your system, specifically the ones for OpenGL - most likely you do not have mesa packages installed.</p>

<p>Follow the instructions for your specific distribution on how to install all of the needed dependencies at:  <a href="https://kivy.org/docs/installation/installation-linux.html#using-software-packages" rel="nofollow">https://kivy.org/docs/installation/installation-linux.html#using-software-packages</a></p>

python linux python-2.7 virtualenv kivy