本帖最后由 aa77dd@163.com 于 2016-9-25 23:05 编辑
回复 6# 523066680

以下过程于 中文 64位 Win 7 成功:
在 python-3.5.2 环境安装 非官方的 PyOpenGL 包,
由于此学校网站外链带宽有限, 我把 已经下载好的文件整体打包, 欢迎试用
http://pan.baidu.com/s/1jIFbWu6
来源: 加州大学欧文分校 LFD 实验室 Christoph Gohlke
http://www.lfd.uci.edu/~gohlke/pythonlibs/
下载并安装
Visual C++ 2015 (x64 and x86 for CPython 3.5) redistributable packages
https://download.microsoft.com/d ... 8/vc_redist.x86.exe
https://download.microsoft.com/d ... 8/vc_redist.x64.exe
python-3.5.2 官方安装文件:
https://www.python.org/ftp/python/3.5.2/python-3.5.2.exe
非官方包:
NumPy, a fundamental package needed for scientific computing with Python.
Numpy+MKL is linked to the Intel? Math Kernel Library and includes required DLLs in the numpy.core directory.
科学计算基础包, Intel 数学核心库
http://www.lfd.uci.edu/~gohlke/p ... p35-cp35m-win32.whl
PyOpenGL:
http://www.lfd.uci.edu/~gohlke/p ... p35-cp35m-win32.whl
PyOpenGL 加速[可选, 推荐安装]
http://www.lfd.uci.edu/~gohlke/p ... p35-cp35m-win32.whl
将 python 3.5 安装到 D:\python353_32 目录,
将 3 个 .whl 文件都拷贝到 D:\python353_32 目录[只是为了安装文件, 不是必须的]
非官方包 CMD 命令行 安装记录: | D:\python353_32\Scripts\pip.exe install D:\python353_32\numpy-1.11.2rc1+mkl-cp35-cp35m-win32.whl | | Processing d:\python353_32\numpy-1.11.2rc1+mkl-cp35-cp35m-win32.whl | | Installing collected packages: numpy | | Successfully installed numpy-1.11.2rc1+mkl | | | | D:\python353_32\Scripts\pip.exe install D:\python353_32\PyOpenGL-3.1.1-cp35-cp35m-win32.whl | | Processing d:\python353_32\pyopengl-3.1.1-cp35-cp35m-win32.whl | | Installing collected packages: PyOpenGL | | Successfully installed PyOpenGL-3.1.1 | | | | D:\python353_32\Scripts\pip.exe install D:\python353_32\PyOpenGL_accelerate-3.1.1-cp35-cp35m-win32.whl | | Processing d:\python353_32\pyopengl_accelerate-3.1.1-cp35-cp35m-win32.whl | | Installing collected packages: PyOpenGL-accelerate | | Successfully installed PyOpenGL-accelerate-3.1.1COPY |
以上完成后, 仍会遇到一个问题 | Traceback (most recent call last): | | File "D:\ttt.py", line 116, in <module> | | main() | | File "D:\ttt.py", line 106, in main | | winid=glutCreateWindow("Vortex") | | File "D:\python353_32\lib\site-packages\OpenGL\GLUT\special.py", line 73, in glutCreateWindow | | return __glutCreateWindowWithExit(title, _exitfunc) | | ctypes.ArgumentError: argument 1: <class 'TypeError'>: wrong typeCOPY |
解决方案 参考: https://codeyarns.com/2012/04/27/pyopengl-glut-ctypes-error/
将第 106 行:winid=glutCreateWindow("Vortex")COPY 改为winid=glutCreateWindow( b"Vortex" )COPY 运行成功! |