$ python pygl_test.py Traceback (most recent call last): File "pygl_test.py", line 92, in main() File "pygl_test.py", line 10, in main if not glfw.init(): File "/home/minimonk/.local/lib/python2.7/site-packages/glfw/__init__.py", line 607, in init res = _glfw.glfwInit() File "/home/minimonk/.local/lib/python2.7/site-packages/glfw/__init__.py", line 516, in errcheck _reraise(exc[1], exc[2]) File "/home/minimonk/.local/lib/python2.7/site-packages/glfw/__init__.py", line 50, in _reraise exec("raise exception, None, traceback") File "/home/minimonk/.local/lib/python2.7/site-packages/glfw/__init__.py", line 495, in callback_wrapper return func(*args, **kwargs) File "/home/minimonk/.local/lib/python2.7/site-packages/glfw/__init__.py", line 669, in _raise_glfw_errors_as_exceptions raise GLFWError(message) glfw.GLFWError: (65544) X11: RandR gamma ramp support seems broken
흐음.. python2.7 이라서 3.7을 깔고 했는데 pip 설치 경로에 따라 다른건가? 3.7에서는 해당 모듈을 불러오질 못한다.
$ python3.7 pygl_test.py Traceback (most recent call last): File "pygl_test.py", line 1, in import glfw ModuleNotFoundError: No module named 'glfw' Error in sys.excepthook: Traceback (most recent call last): File "/usr/lib/python3/dist-packages/apport_python_hook.py", line 63, in apport_excepthook from apport.fileutils import likely_packaged, get_recent_crashes File "/usr/lib/python3/dist-packages/apport/__init__.py", line 5, in from apport.report import Report File "/usr/lib/python3/dist-packages/apport/report.py", line 30, in import apport.fileutils File "/usr/lib/python3/dist-packages/apport/fileutils.py", line 23, in from apport.packaging_impl import impl as packaging File "/usr/lib/python3/dist-packages/apport/packaging_impl.py", line 24, in import apt File "/usr/lib/python3/dist-packages/apt/__init__.py", line 23, in import apt_pkg ModuleNotFoundError: No module named 'apt_pkg'
Original exception was: Traceback (most recent call last): File "pygl_test.py", line 1, in import glfw ModuleNotFoundError: No module named 'glfw'
ubuntu 깔고 native로 했는데 안된다.. ㅠㅠ GLSL3.30을 지원하지 않아서 라니 ㅠㅠ
$ python pygl.py No handlers could be found for logger "OpenGL.arrays.numpymodule" Traceback (most recent call last): File "pygl.py", line 92, in main() File "pygl.py", line 56, in main shader = OpenGL.GL.shaders.compileProgram(OpenGL.GL.shaders.compileShader(vertex_shader, GL_VERTEX_SHADER), File "/home/minimonk/.local/lib/python2.7/site-packages/OpenGL/GL/shaders.py", line 226, in compileShader shaderType, RuntimeError: ('Shader compile failure (0): 0:2(10): error: GLSL 3.30 is not supported. Supported versions are: 1.10, 1.20, 1.30, 1.00 ES, and 3.00 ES\n', ['\n #version 330\n in vec3 position;\n in vec3 color;\n\n out vec3 newColor;\n void main()\n {\n gl_Position = vec4(position, 1.0f);\n newColor = color;\n }\n '], GL_VERTEX_SHADER)
$ python3 pygl_test.py Traceback (most recent call last): File "pygl_test.py", line 92, in main() File "pygl_test.py", line 10, in main if not glfw.init(): File "/home/minimonk/.local/lib/python3.6/site-packages/glfw/__init__.py", line 607, in init res = _glfw.glfwInit() File "/home/minimonk/.local/lib/python3.6/site-packages/glfw/__init__.py", line 516, in errcheck _reraise(exc[1], exc[2]) File "/home/minimonk/.local/lib/python3.6/site-packages/glfw/__init__.py", line 45, in _reraise raise exception.with_traceback(traceback) File "/home/minimonk/.local/lib/python3.6/site-packages/glfw/__init__.py", line 495, in callback_wrapper return func(*args, **kwargs) File "/home/minimonk/.local/lib/python3.6/site-packages/glfw/__init__.py", line 669, in _raise_glfw_errors_as_exceptions raise GLFWError(message) glfw.GLFWError: (65544) b'X11: RandR gamma ramp support seems broken'
옛날 글이고 18.04 / python3에는 아래 패키지를 깔아주면 되는 듯.
$ sudo apt-get install python3-opengl
Install the distribution package as: sudo apt-get install python-opengl - this works for me.
전체 사용자 설치로 하면 사용자 권한 문제로 pip로 설치시 안되는 수가 있어서 --user 옵션을 주어야 함
Could not install packages due to an EnvironmentError: [WinError 5] 액세스가 거부되었습니다: 'c:\\program files (x86)\\python37-32\\lib\\site-packages\\pip-19.0.3.dist-info\\entry_points.txt' Consider using the `--user` option or check the permissions.
---
python 3.7.3에
mingw 실패
ms vs community에 14.0 빌드툴 추가해도 실패
python 3.4.3 에
mingw 실패
그래서 고민하다가 원래대로 해보겠다고 고생중
Microsoft Visual C++ 14.0 standalone: Visual C++ Build Tools 2015 (x86, x64, ARM)
This is a standalone version ofVisual C++ 14.0compiler, you don't need to installVisual Studio 2015.
C:\study\python>python gl.py Traceback (most recent call last): File "gl.py", line 92, in main() File "gl.py", line 13, in main window = glfw.create_window(800, 600, "My OpenGL window", None, None) File "C:\Users\shin\AppData\Local\Programs\Python\Python37-32\lib\site-packages\glfw\__init__.py", line 893, in create_window monitor, share) File "C:\Users\shin\AppData\Local\Programs\Python\Python37-32\lib\site-packages\glfw\__init__.py", line 516, in errcheck _reraise(exc[1], exc[2]) File "C:\Users\shin\AppData\Local\Programs\Python\Python37-32\lib\site-packages\glfw\__init__.py", line 45, in _reraise raise exception.with_traceback(traceback) File "C:\Users\shin\AppData\Local\Programs\Python\Python37-32\lib\site-packages\glfw\__init__.py", line 495, in callback_wrapper return func(*args, **kwargs) File "C:\Users\shin\AppData\Local\Programs\Python\Python37-32\lib\site-packages\glfw\__init__.py", line 669, in _raise_glfw_errors_as_exceptions raise GLFWError(message) glfw.GLFWError: (65542) b'WGL: The driver does not appear to support OpenGL'