title: ImportError: Library "GLU" not found
body: <p>On CentOS 7.5 system, run python3 and execute the following code:</p>
  
  <pre><code>import gym
  import time
  env = gym.make('CartPole-v0')
  observation = env.reset()
  count = 0
  for t in range(100):
      action = env.action_space.sample()
      observation, reward, done, info = env.step(action)
      if done: 
          break
      env.render()
      count+=1
      time.sleep(0.2)
  </code></pre>
  
  <p>Report the following error after executing the above code:      </p>
  
  <pre><code>Traceback (most recent call last):
    File "&lt;stdin&gt;", line 6, in &lt;module&gt;
    File "/root/gym/gym/core.py", line 284, in render
      return self.env.render(mode)
    File "/root/gym/gym/envs/classic_control/cartpole.py", line 106, in render
      from gym.envs.classic_control import rendering
    File "/root/gym/gym/envs/classic_control/rendering.py", line 25, in &lt;module&gt;
      reraise(prefix="Error occured while running `from pyglet.gl import *`",suffix="HINT: make sure you have OpenGL install. On Ubuntu, you can run 'apt-get install python-opengl'. If you're running on a server, you may need a virtual frame buffer; something like this should work: 'xvfb-run -s \"-screen 0 1400x900x24\" python &lt;your_script.py&gt;'")
    File "/root/gym/gym/utils/reraise.py", line 17, in reraise
      reraise_impl(e, traceback)
    File "/root/gym/gym/utils/reraise_impl_py3.py", line 4, in reraise_impl
      raise e.with_traceback(traceback) from None
    File "/root/gym/gym/envs/classic_control/rendering.py", line 23, in &lt;module&gt;
      from pyglet.gl import *
    File "/root/anaconda3/envs/gymlab/lib/python3.6/site-packages/pyglet/gl/__init__.py", line 100, in &lt;module&gt;
      from pyglet.gl.lib import GLException
    File "/root/anaconda3/envs/gymlab/lib/python3.6/site-packages/pyglet/gl/lib.py", line 143, in &lt;module&gt;
      from pyglet.gl.lib_glx import link_GL, link_GLU, link_GLX
    File "/root/anaconda3/envs/gymlab/lib/python3.6/site-packages/pyglet/gl/lib_glx.py", line 51, in &lt;module&gt;
      glu_lib = pyglet.lib.load_library('GLU')
    File "/root/anaconda3/envs/gymlab/lib/python3.6/site-packages/pyglet/lib.py", line 158, in load_library
      raise ImportError('Library "%s" not found.' % names[0])
  gym.utils.reraise.ReraisedException: Error occured while running `from pyglet.gl import *`
  </code></pre>
  
  <p>The original exception was:</p>
  
  <pre><code>ImportError: Library "GLU" not found.
  
  HINT: make sure you have OpenGL install. On Ubuntu, you can run 'apt-get install python-opengl'. If you're running on a server, you may need a virtual frame buffer; something like this should work: 'xvfb-run -s "-screen 0 1400x900x24" python &lt;your_script.py&gt;'
  </code></pre>
  
  <p>According to the error prompt, after installing OpenGL, the running code will still report the same error. The following is the process of installing OpenGL:</p>
  
  <pre><code>[root@devmaster ~]# yum -y install python-opengl
  Loaded plugins: fastestmirror, langpacks
  Loading mirror speeds from cached hostfile
   * base: mirrors.aliyun.com
   * extras: mirrors.tuna.tsinghua.edu.cn
   * updates: ftp.iij.ad.jp
  Package PyOpenGL-3.0.1-6.el7.noarch already installed and latest version
  Nothing to do
  [root@devmaster ~]#
  </code></pre>