Minecraft icon indicating copy to clipboard operation
Minecraft copied to clipboard

NameError: name 'GL_FOG' is not defined

Open MasterHansCoding opened this issue 2 years ago • 9 comments

When I run main.py I get this error. What should I do?

MasterHansCoding avatar Dec 21 '22 23:12 MasterHansCoding

me too

captain-wangrun-cn avatar Dec 24 '22 02:12 captain-wangrun-cn

me too

ghost avatar Dec 29 '22 02:12 ghost

me too...

Dada010101 avatar Jan 05 '23 15:01 Dada010101

I got the same error, I resolved by installing PyOpenGL

pip install PyOpenGL

And later imported these two statements

from OpenGL.GL import *
from OpenGL.GLU import *

Import and NameError are resolved but now I'm getting another error

raise GLException('(0x%x): %s' % (error, msg))
pyglet.gl.lib.GLException: (0x500): Invalid enum. An unacceptable value is specified for an enumerated argument.

rish-hyun avatar Jan 06 '23 13:01 rish-hyun

I got the same error, I resolved by installing PyOpenGL

pip install PyOpenGL

And later imported these two statements

from OpenGL.GL import *
from OpenGL.GLU import *

Import and NameError are resolved but now I'm getting another error

raise GLException('(0x%x): %s' % (error, msg))
pyglet.gl.lib.GLException: (0x500): Invalid enum. An unacceptable value is specified for an enumerated argument.

I've downgraded to pyglet==1.5.27, and it's working! No need to install PyOpenGL

rish-hyun avatar Jan 06 '23 17:01 rish-hyun

I got the same error, I resolved by installing PyOpenGL

pip install PyOpenGL

And later imported these two statements

from OpenGL.GL import *
from OpenGL.GLU import *

Import and NameError are resolved but now I'm getting another error

raise GLException('(0x%x): %s' % (error, msg))
pyglet.gl.lib.GLException: (0x500): Invalid enum. An unacceptable value is specified for an enumerated argument.

I've downgraded to pyglet==1.5.27, and it's working! No need to install PyOpenGL

Thank you for posting your solution! Your steps worked for me.

For others downgrading pyglet, you can do so by running pip install pyglet==1.5.27

michaelboerman avatar Apr 04 '23 21:04 michaelboerman

i guess git pull the pyglet version in the how to run in the README.md add ' pip install pyglet==1.5.27 '

iTSiolinux avatar Jun 01 '23 22:06 iTSiolinux

Me too. I move it to my new laptop,but it got this error… What can I do?

[Running] python -u "e:\Minecraft-master\main.py"
Traceback (most recent call last):
  File "e:\Minecraft-master\main.py", line 902, in <module>
    main()
  File "e:\Minecraft-master\main.py", line 897, in main
    setup()
  File "e:\Minecraft-master\main.py", line 890, in setup
    setup_fog()
  File "e:\Minecraft-master\main.py", line 861, in setup_fog
    glEnable(GL_FOG)
             ^^^^^^
NameError: name 'GL_FOG' is not defined

[Done] exited with code=1 in 0.776 seconds

Screenshot 2024-04-08 120628

RequiemxOP avatar Apr 08 '24 06:04 RequiemxOP