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

GLAttributes returned a result with an error set #449

Closed
Peng1029 opened this issue Oct 27, 2021 · 9 comments
Closed

GLAttributes returned a result with an error set #449

Peng1029 opened this issue Oct 27, 2021 · 9 comments
Labels
opengl an error from OpenGL code priority: medium this ticket needs resolving soon type: bug Something isn't working
Milestone

Comments

@Peng1029
Copy link

Has this bug already been reported? Please check if there is a bug report already open that matches this.

Describe the bug
A clear and concise description of what the bug is.

After clicking 3d editor I get

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
File "/home/peng/.local/lib/python3.9/site-packages/amulet_map_editor/api/framework/pages/world_page.py", line 155, in _enable_active
self._extensions[self.GetSelection()].enable()
File "/home/peng/.local/lib/python3.9/site-packages/amulet_map_editor/programs/edit/edit.py", line 50, in enable
self._canvas = EditCanvas(self, self._world, self._close_self_callback)
File "/home/peng/.local/lib/python3.9/site-packages/amulet_map_editor/programs/edit/api/canvas/edit_canvas.py", line 92, in init
super().init(parent, world)
File "/home/peng/.local/lib/python3.9/site-packages/amulet_map_editor/programs/edit/api/canvas/base_edit_canvas.py", line 58, in init
super().init(parent)
File "/home/peng/.local/lib/python3.9/site-packages/amulet_map_editor/api/opengl/canvas/event_canvas.py", line 12, in init
super().init(parent)
File "/home/peng/.local/lib/python3.9/site-packages/amulet_map_editor/api/opengl/canvas/canvas.py", line 23, in init
display_attributes = wx.glcanvas.GLAttributes()
SystemError: <class 'wx._glcanvas.GLAttributes'> returned a result with an error set
`

and then get locked out of the 3d editor

To Reproduce
Steps to reproduce the behavior:

  1. Just follow the install for linux from scratch in a python env
  2. Load a minecraft bedrock world
  3. Click on 3d editor
  4. See error

Expected behavior
A clear and concise description of what you expected to happen.
The 3d editor starts
Screenshots
The error message showed both in the console & in a popup on screen

Desktop (please complete the following information):
image

Additional context
Add any other context about the problem here.
Could be from the amount of corrupted files on my failing harddrive messing with python or something

@quaderror
Copy link

I'm getting this exact behaviour too on Arch with Gnome under both X and Wayland, with a fresh python virtual environment. No idea how to pry further into wxPython's behaviour though!

@quaderror
Copy link

I resolved this issue for my particular setup by installing the Arch community/python-wxpython package.

I got a list of packages installed outside the virtual environment from a different machine with a working instance of Amulet on a hunch that pip was missing something wxpython required. I compared the package list on the working machine to the package list on the machine experiencing this error; a bunch of them were missing (working machine has a lot of cruft) and the python-wxpython was among them.

I'm assuming having installed wxpython using the package manager provided something opengl-related that pip missed, but I've no idea how to investigate it further.

@jimbt

This comment has been minimized.

@gentlegiantJGC
Copy link
Member

Please open a new bug report. Your issue is different to this one

@gentlegiantJGC gentlegiantJGC added this to the bug-fix milestone Nov 24, 2021
@gentlegiantJGC gentlegiantJGC added the type: bug Something isn't working label Nov 24, 2021
@gentlegiantJGC gentlegiantJGC added state: triage the severity of this ticket needs evaluating priority: medium this ticket needs resolving soon and removed state: triage the severity of this ticket needs evaluating labels Apr 26, 2022
@gentlegiantJGC gentlegiantJGC added the opengl an error from OpenGL code label May 18, 2022
@gentlegiantJGC gentlegiantJGC changed the title 3d editor... Multiple errors? GLAttributes returned a result with an error set Sep 5, 2022
@gentlegiantJGC
Copy link
Member

This is still an issue and only effects some users on linux.
There may be more information in #465 related to this issue.

@Max-RM
Copy link
Contributor

Max-RM commented Jan 14, 2023

the error message has now changed in Amulet 0.10.8

`<class 'wx._glcanvas.GLAttributes'> returned a result with an error set
NotImplementedError

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
File "/usr/local/lib/python3.9/site-packages/amulet_map_editor/api/framework/pages/world_page.py", line 178, in _enable_page
self.GetPage(page).enable()
File "/usr/local/lib/python3.9/site-packages/amulet_map_editor/programs/edit/edit.py", line 70, in enable
self._canvas = EditCanvas(self, self._world)
File "/usr/local/lib/python3.9/site-packages/amulet_map_editor/programs/edit/api/canvas/edit_canvas.py", line 150, in init
super().init(parent, world)
File "/usr/local/lib/python3.9/site-packages/amulet_map_editor/programs/edit/api/canvas/base_edit_canvas.py", line 62, in init
super().init(parent)
File "/usr/local/lib/python3.9/site-packages/amulet_map_editor/api/opengl/canvas/event_canvas.py", line 15, in init
super().init(parent)
File "/usr/local/lib/python3.9/site-packages/amulet_map_editor/api/opengl/canvas/canvas.py", line 41, in init
display_attributes = glcanvas.GLAttributes()
SystemError: <class 'wx._glcanvas.GLAttributes'> returned a result with an error set
`

@Flonja
Copy link

Flonja commented Apr 3, 2023

After following a bit of the instructions at https://wxpython.org/pages/downloads/ and using this command pip install -U -f https://extras.wxpython.org/wxPython4/extras/linux/gtk3/ubuntu-18.04 wxPython==4.1.1 --force-reinstall, I got the editor to work! Albeit in the state found at #127.
The reason why I used ubuntu-18.04 is because it had the needed version 4.1.1 and it was for python 3.9 too.

For some reason the version that pip installs is wrong(?)

@wwwwwert
Copy link

It seems I found a solution. WXPython uses CPython to compile some classes. If it does not find some dependencies it just skips the compilation of related class (this is only MY THEORY). So, before installing WXPython you need to install some OpenGL dependencies.
Commands (Ubuntu):

  1. pip install wxPython
  2. sudo apt-get install freeglut3-dev
  3. pip install wxPython --no-cache-dir

You might also check for other missing OpenGL dependencies for wxPython
Source: https://stackoverflow.com/questions/62924897/failed-to-compile-wxwidget-3-0-5-opengl-libraries-not-available

@Xalalau
Copy link

Xalalau commented Mar 10, 2024

It seems I found a solution. WXPython uses CPython to compile some classes. If it does not find some dependencies it just skips the compilation of related class (this is only MY THEORY). So, before installing WXPython you need to install some OpenGL dependencies. Commands (Ubuntu):

  1. pip install wxPython
  2. sudo apt-get install freeglut3-dev
  3. pip install wxPython --no-cache-dir

You might also check for other missing OpenGL dependencies for wxPython Source: https://stackoverflow.com/questions/62924897/failed-to-compile-wxwidget-3-0-5-opengl-libraries-not-available

Yep, it works! Ty very much.
image

Fixed typo in the first command:

  1. pip3 uninstall wxPython
  2. sudo apt-get install freeglut3-dev
  3. pip3 install wxPython --no-cache-dir

Note: the options are flickering like crazy! (#127) But I managed to open, edit and save multiple maps at the same time.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
opengl an error from OpenGL code priority: medium this ticket needs resolving soon type: bug Something isn't working
Projects
None yet
Development

No branches or pull requests

8 participants