This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: AttributeError (GL_READ_WRITE) when importing OpenGL.GL
Type: behavior Stage: resolved
Components: Extension Modules Versions: Python 3.5
process
Status: closed Resolution: third party
Dependencies: Superseder:
Assigned To: Nosy List: berker.peksag, yoha
Priority: normal Keywords:

Created on 2016-01-31 09:31 by yoha, last changed 2022-04-11 14:58 by admin. This issue is now closed.

Messages (2)
msg259276 - (view) Author: Yoha (yoha) Date: 2016-01-31 09:31
Importing `OpenGL.GL` fails on Python 3.5:

```
Python 3.5.1+ (default, Jan 13 2016, 15:09:18) 
[GCC 5.3.1 20160101] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import OpenGL.GL
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/usr/lib/python3/dist-packages/OpenGL/GL/__init__.py", line 3, in <module>
    from OpenGL.GL.VERSION.GL_1_1 import *
  File "/usr/lib/python3/dist-packages/OpenGL/GL/VERSION/GL_1_1.py", line 10, in <module>
    from OpenGL import platform, constants, constant, arrays
  File "/usr/lib/python3/dist-packages/OpenGL/arrays/__init__.py", line 22, in <module>
    formathandler.FormatHandler.loadAll()
  File "/usr/lib/python3/dist-packages/OpenGL/arrays/formathandler.py", line 28, in loadAll
    cls.loadPlugin( entrypoint )
  File "/usr/lib/python3/dist-packages/OpenGL/arrays/formathandler.py", line 35, in loadPlugin
    plugin_class = entrypoint.load()
  File "/usr/lib/python3/dist-packages/OpenGL/plugins.py", line 14, in load
    return importByName( self.import_path )
  File "/usr/lib/python3/dist-packages/OpenGL/plugins.py", line 28, in importByName
    module = __import__( ".".join(moduleName), {}, {}, moduleName)
  File "/usr/lib/python3/dist-packages/OpenGL/arrays/vbo.py", line 430, in <module>
    def mapVBO( vbo, access=GL.GL_READ_WRITE ):
AttributeError: module 'OpenGL.GL' has no attribute 'GL_READ_WRITE'
```

It seems to work fine in Python 3.4:

```
Python 3.4.4 (default, Jan  5 2016, 15:35:18) 
[GCC 5.3.1 20160101] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import OpenGL.GL
>>> 
```

Or by first importing `OpenGL.GLU`:

```
Python 3.5.1+ (default, Jan 13 2016, 15:09:18) 
[GCC 5.3.1 20160101] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import OpenGL.GLU
>>> import OpenGL.GL
>>> 
```
msg259277 - (view) Author: Berker Peksag (berker.peksag) * (Python committer) Date: 2016-01-31 09:44
Thanks for the report, Yoha. Your third example shows that this is either an error in PyOpenGL or there is something wrong in your PyOpenGL installation. Please report this to their issue tracker.
History
Date User Action Args
2022-04-11 14:58:27adminsetgithub: 70433
2016-01-31 09:44:35berker.peksagsetstatus: open -> closed

type: crash -> behavior

nosy: + berker.peksag
messages: + msg259277
resolution: third party
stage: resolved
2016-01-31 09:31:55yohacreate