Computer Graphic with Python: setup libraries
dinhanhx
Posted on March 2, 2021
This post is just how I install stuffs to deal with Computer Graphic course by using Python on Windows.
My environment:
- Python 3.8
- Windows 10 Pro 20H2 64bit
PyOpenGL
According to PyOpenGL Documentation, installing via PIP should work
pip install PyOpenGL PyOpenGL_accelerate
It doesn't work irl. If you have installed via pip, please uninstall them.
Now please go to this site for Unofficial Windows Binaries for Python Extension Packages to get .whl
files to install PyOpenGL.
https://www.lfd.uci.edu/~gohlke/pythonlibs/#pyopengl
Now check your Python version and Windows bit version. Then download PyOpenGL_accelerate and PyOpenGL files corresponding to your enviroment.
In my case, Python 3.8 and Windows 64 bit. I had to download these files then install:
PyOpenGL_accelerate‑3.1.5‑cp38‑cp38‑win_amd64.whl
PyOpenGL‑3.1.5‑cp38‑cp38‑win_amd64.whl
Note:
-
amd64
is for Windows 64 bit -
cp38-cp38
is for Python 3.8
Then you just need pip install
whl files.
pip install path/to/filename.whl
ModernGL
Alternatively, you can choose to use ModernGL which is recommended by a lot of people on Stackoverflow.
In contrast, ModernGL is easy to learn and use, moreover it is capable of rendering with high performance and quality, with less code written.
~ ModernGL ~
Installation is very simple
pip install moderngl moderngl-window
Documentation:
- moderngl
- moderngl-window for managing window, mouse, keyboard
Pyglet
Alternatively, you can use pyglet.gl
.
Installation is very simple
pip install pyglet
Documentation:
Posted on March 2, 2021
Join Our Newsletter. No Spam, Only the good stuff.
Sign up to receive the latest update from our blog.