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

NameError: name 'GL_FOG' is not defined #147

Open
MasterHansCoding opened this issue Dec 21, 2022 · 9 comments
Open

NameError: name 'GL_FOG' is not defined #147

MasterHansCoding opened this issue Dec 21, 2022 · 9 comments

Comments

@MasterHansCoding
Copy link

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

@captain-explain-wangrun-chn

me too

1 similar comment
@dzx825
Copy link

dzx825 commented Dec 29, 2022

me too

@Dada010101
Copy link

me too...

@rish-hyun
Copy link

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
Copy link

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

@michaelboerman
Copy link

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

This was referenced Apr 4, 2023
@iTSiolinux
Copy link

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

@Sjxooooooooooooooooooooooooooo

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

@RequiemxOP
Copy link

Screenshot 2024-04-08 120628

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

9 participants