我正在尝试在计算机上安装 PyOpenGL :
显然,我需要同时安装PyOpenGL
和PyOpenGL_accelerate
软件包。
命令pip install PyOpenGL
可以正常工作:
C:\Users\Kristof>pip install PyOpenGL
Collecting PyOpenGL
Installing collected packages: PyOpenGL
Successfully installed PyOpenGL-3.1.0
命令pip install PyOpenGL_accelerate
失败:
C:\Python37\PyOpenGL-accelerate-3.1.0>pip install PyOpenGL_accelerate --no-cache-dir
Collecting PyOpenGL_accelerate
Downloading https://files.pythonhosted.org/packages/d9/74/293aa8794f2f236186d19e61c5548160bfe159c996ba01ed9144c89ee8ee/PyOpenGL-accelerate-3.1.0.tar.gz (323kB)
|████████████████████████████████| 327kB 1.3MB/s
Building wheels for collected packages: PyOpenGL-accelerate
Building wheel for PyOpenGL-accelerate (setup.py) ... error
ERROR: Command errored out with exit status 1:
command: 'c:\python37\python.exe' -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\Kristof\\AppData\\Local\\Temp\\pip-install-w04pgijy\\PyOpenGL-accelerate\\setup.py'"'"'; __file__='"'"'C:\\Users\\Kristof\\AppData\\Local\\Temp\\pip-install-w04pgijy\\PyOpenGL-accelerate\\setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' bdist_wheel -d 'C:\Users\Kristof\AppData\Local\Temp\pip-wheel-x4gprfbc' --python-tag cp37
cwd: C:\Users\Kristof\AppData\Local\Temp\pip-install-w04pgijy\PyOpenGL-accelerate\
Complete output (48 lines):
running bdist_wheel
running build
running build_py
creating build
creating build\lib.win-amd64-3.7
creating build\lib.win-amd64-3.7\OpenGL_accelerate
copying .\__init__.py -> build\lib.win-amd64-3.7\OpenGL_accelerate
running build_ext
skipping 'src\wrapper.c' Cython extension (up-to-date)
building 'OpenGL_accelerate.wrapper' extension
creating build\temp.win-amd64-3.7
creating build\temp.win-amd64-3.7\Release
creating build\temp.win-amd64-3.7\Release\src
C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.16.27023\bin\HostX86\x64\cl.exe /c /nologo /Ox /W3 /GL /DNDEBUG /MD -IC:\Users\Kristof\AppData\Local\Temp\pip-install-w04pgijy\PyOpenGL-accelerate\.. -IC:\Users\Kristof\AppData\Local\Temp\pip-install-w04pgijy\PyOpenGL-accelerate\src -IC:\Users\Kristof\AppData\Local\Temp\pip-install-w04pgijy\PyOpenGL-accelerate -Ic:\python37\include -Ic:\python37\include "-IC:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.16.27023\ATLMFC\include" "-IC:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.16.27023\include" "-IC:\Program Files (x86)\Windows Kits\NETFXSDK\4.6.1\include\um" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.17763.0\ucrt" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.17763.0\shared" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.17763.0\um" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.17763.0\winrt" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.17763.0\cppwinrt" /Tcsrc\wrapper.c /Fobuild\temp.win-amd64-3.7\Release\src\wrapper.obj
wrapper.c
src\wrapper.c(3919): warning C4244: '=': conversion from 'Py_ssize_t' to 'int', possible loss of data
src\wrapper.c(4376): warning C4244: '=': conversion from 'Py_ssize_t' to 'int', possible loss of data
src\wrapper.c(11474): error C2039: 'exc_type': is not a member of '_ts'
c:\python37\include\pystate.h(209): note: see declaration of '_ts'
src\wrapper.c(11475): error C2039: 'exc_value': is not a member of '_ts'
c:\python37\include\pystate.h(209): note: see declaration of '_ts'
src\wrapper.c(11476): error C2039: 'exc_traceback': is not a member of '_ts'
c:\python37\include\pystate.h(209): note: see declaration of '_ts'
src\wrapper.c(11488): error C2039: 'exc_type': is not a member of '_ts'
c:\python37\include\pystate.h(209): note: see declaration of '_ts'
src\wrapper.c(11489): error C2039: 'exc_value': is not a member of '_ts'
c:\python37\include\pystate.h(209): note: see declaration of '_ts'
src\wrapper.c(11490): error C2039: 'exc_traceback': is not a member of '_ts'
c:\python37\include\pystate.h(209): note: see declaration of '_ts'
src\wrapper.c(11491): error C2039: 'exc_type': is not a member of '_ts'
c:\python37\include\pystate.h(209): note: see declaration of '_ts'
src\wrapper.c(11492): error C2039: 'exc_value': is not a member of '_ts'
c:\python37\include\pystate.h(209): note: see declaration of '_ts'
src\wrapper.c(11493): error C2039: 'exc_traceback': is not a member of '_ts'
c:\python37\include\pystate.h(209): note: see declaration of '_ts'
src\wrapper.c(11536): error C2039: 'exc_type': is not a member of '_ts'
c:\python37\include\pystate.h(209): note: see declaration of '_ts'
src\wrapper.c(11537): error C2039: 'exc_value': is not a member of '_ts'
c:\python37\include\pystate.h(209): note: see declaration of '_ts'
src\wrapper.c(11538): error C2039: 'exc_traceback': is not a member of '_ts'
c:\python37\include\pystate.h(209): note: see declaration of '_ts'
src\wrapper.c(11539): error C2039: 'exc_type': is not a member of '_ts'
c:\python37\include\pystate.h(209): note: see declaration of '_ts'
src\wrapper.c(11540): error C2039: 'exc_value': is not a member of '_ts'
c:\python37\include\pystate.h(209): note: see declaration of '_ts'
src\wrapper.c(11541): error C2039: 'exc_traceback': is not a member of '_ts'
c:\python37\include\pystate.h(209): note: see declaration of '_ts'
error: command 'C:\\Program Files (x86)\\Microsoft Visual Studio\\2017\\Community\\VC\\Tools\\MSVC\\14.16.27023\\bin\\HostX86\\x64\\cl.exe' failed with exit status 2
----------------------------------------
ERROR: Failed building wheel for PyOpenGL-accelerate
Running setup.py clean for PyOpenGL-accelerate
Failed to build PyOpenGL-accelerate
Installing collected packages: PyOpenGL-accelerate
Running setup.py install for PyOpenGL-accelerate ... error
ERROR: Command errored out with exit status 1:
command: 'c:\python37\python.exe' -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\Kristof\\AppData\\Local\\Temp\\pip-install-w04pgijy\\PyOpenGL-accelerate\\setup.py'"'"'; __file__='"'"'C:\\Users\\Kristof\\AppData\\Local\\Temp\\pip-install-w04pgijy\\PyOpenGL-accelerate\\setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record 'C:\Users\Kristof\AppData\Local\Temp\pip-record-1ulnpq1p\install-record.txt' --single-version-externally-managed --compile
cwd: C:\Users\Kristof\AppData\Local\Temp\pip-install-w04pgijy\PyOpenGL-accelerate\
Complete output (48 lines):
running install
running build
running build_py
creating build
creating build\lib.win-amd64-3.7
creating build\lib.win-amd64-3.7\OpenGL_accelerate
copying .\__init__.py -> build\lib.win-amd64-3.7\OpenGL_accelerate
running build_ext
skipping 'src\wrapper.c' Cython extension (up-to-date)
building 'OpenGL_accelerate.wrapper' extension
creating build\temp.win-amd64-3.7
creating build\temp.win-amd64-3.7\Release
creating build\temp.win-amd64-3.7\Release\src
C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.16.27023\bin\HostX86\x64\cl.exe /c /nologo /Ox /W3 /GL /DNDEBUG /MD -IC:\Users\Kristof\AppData\Local\Temp\pip-install-w04pgijy\PyOpenGL-accelerate\.. -IC:\Users\Kristof\AppData\Local\Temp\pip-install-w04pgijy\PyOpenGL-accelerate\src -IC:\Users\Kristof\AppData\Local\Temp\pip-install-w04pgijy\PyOpenGL-accelerate -Ic:\python37\include -Ic:\python37\include "-IC:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.16.27023\ATLMFC\include" "-IC:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.16.27023\include" "-IC:\Program Files (x86)\Windows Kits\NETFXSDK\4.6.1\include\um" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.17763.0\ucrt" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.17763.0\shared" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.17763.0\um" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.17763.0\winrt" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.17763.0\cppwinrt" /Tcsrc\wrapper.c /Fobuild\temp.win-amd64-3.7\Release\src\wrapper.obj
wrapper.c
src\wrapper.c(3919): warning C4244: '=': conversion from 'Py_ssize_t' to 'int', possible loss of data
src\wrapper.c(4376): warning C4244: '=': conversion from 'Py_ssize_t' to 'int', possible loss of data
src\wrapper.c(11474): error C2039: 'exc_type': is not a member of '_ts'
c:\python37\include\pystate.h(209): note: see declaration of '_ts'
src\wrapper.c(11475): error C2039: 'exc_value': is not a member of '_ts'
c:\python37\include\pystate.h(209): note: see declaration of '_ts'
src\wrapper.c(11476): error C2039: 'exc_traceback': is not a member of '_ts'
c:\python37\include\pystate.h(209): note: see declaration of '_ts'
src\wrapper.c(11488): error C2039: 'exc_type': is not a member of '_ts'
c:\python37\include\pystate.h(209): note: see declaration of '_ts'
src\wrapper.c(11489): error C2039: 'exc_value': is not a member of '_ts'
c:\python37\include\pystate.h(209): note: see declaration of '_ts'
src\wrapper.c(11490): error C2039: 'exc_traceback': is not a member of '_ts'
c:\python37\include\pystate.h(209): note: see declaration of '_ts'
src\wrapper.c(11491): error C2039: 'exc_type': is not a member of '_ts'
c:\python37\include\pystate.h(209): note: see declaration of '_ts'
src\wrapper.c(11492): error C2039: 'exc_value': is not a member of '_ts'
c:\python37\include\pystate.h(209): note: see declaration of '_ts'
src\wrapper.c(11493): error C2039: 'exc_traceback': is not a member of '_ts'
c:\python37\include\pystate.h(209): note: see declaration of '_ts'
src\wrapper.c(11536): error C2039: 'exc_type': is not a member of '_ts'
c:\python37\include\pystate.h(209): note: see declaration of '_ts'
src\wrapper.c(11537): error C2039: 'exc_value': is not a member of '_ts'
c:\python37\include\pystate.h(209): note: see declaration of '_ts'
src\wrapper.c(11538): error C2039: 'exc_traceback': is not a member of '_ts'
c:\python37\include\pystate.h(209): note: see declaration of '_ts'
src\wrapper.c(11539): error C2039: 'exc_type': is not a member of '_ts'
c:\python37\include\pystate.h(209): note: see declaration of '_ts'
src\wrapper.c(11540): error C2039: 'exc_value': is not a member of '_ts'
c:\python37\include\pystate.h(209): note: see declaration of '_ts'
src\wrapper.c(11541): error C2039: 'exc_traceback': is not a member of '_ts'
c:\python37\include\pystate.h(209): note: see declaration of '_ts'
error: command 'C:\\Program Files (x86)\\Microsoft Visual Studio\\2017\\Community\\VC\\Tools\\MSVC\\14.16.27023\\bin\\HostX86\\x64\\cl.exe' failed with exit status 2
----------------------------------------
ERROR: Command errored out with exit status 1: 'c:\python37\python.exe' -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\Kristof\\AppData\\Local\\Temp\\pip-install-w04pgijy\\PyOpenGL-accelerate\\setup.py'"'"'; __file__='"'"'C:\\Users\\Kristof\\AppData\\Local\\Temp\\pip-install-w04pgijy\\PyOpenGL-accelerate\\setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record 'C:\Users\Kristof\AppData\Local\Temp\pip-record-1ulnpq1p\install-record.txt' --single-version-externally-managed --compile Check the logs for full command output.
我下载了适用于Windows 64位的预编译软件包:
https://pypi.org/project/PyOpenGL-accelerate/#files
没有适用于Python 3.7的文件,所以我选择了最新的文件,适用于Python 3.4:
PyOpenGL-accelerate-3.1.0.win-amd64-py3.4.exe
不幸的是,安装过程因错误消息而停止:找不到Python 3.4安装。
我回到相同的下载页面:
https://pypi.org/project/PyOpenGL-accelerate/#files
然后我下载了源代码:
PyOpenGL-accelerate-3.1.0.zip (340.0 kB)
接下来,我打开Windows终端,导航到解压缩的文件夹并运行setup.py
(注意:我的Python 3.7安装位于C:\Python37\
中,而我解压缩了C:\Python37\PyOpenGL-accelerate-3.1.0
中的文件夹):
C:\Users\Kristof>cd C:\Python37\PyOpenGL-accelerate-3.1.0
C:\Python37\PyOpenGL-accelerate-3.1.0>python setup.py install
running install
running bdist_egg
running egg_info
writing PyOpenGL_accelerate.egg-info\PKG-INFO
writing dependency_links to PyOpenGL_accelerate.egg-info\dependency_links.txt
writing top-level names to PyOpenGL_accelerate.egg-info\top_level.txt
reading manifest file 'PyOpenGL_accelerate.egg-info\SOURCES.txt'
reading manifest template 'MANIFEST.in'
writing manifest file 'PyOpenGL_accelerate.egg-info\SOURCES.txt'
installing library code to build\bdist.win-amd64\egg
running install_lib
running build_py
creating build
creating build\lib.win-amd64-3.7
creating build\lib.win-amd64-3.7\OpenGL_accelerate
copying .\__init__.py -> build\lib.win-amd64-3.7\OpenGL_accelerate
running build_ext
skipping 'src\wrapper.c' Cython extension (up-to-date)
building 'OpenGL_accelerate.wrapper' extension
creating build\temp.win-amd64-3.7
creating build\temp.win-amd64-3.7\Release
creating build\temp.win-amd64-3.7\Release\src
C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.16.27023\bin\HostX86\x64\cl.exe /c /nologo /Ox /W3 /GL /DNDEBUG /MD -IC:\Python37\PyOpenGL-accelerate-3.1.0\.. -IC:\Python37\PyOpenGL-accelerate-3.1.0\src -IC:\Python37\PyOpenGL-accelerate-3.1.0 -IC:\Python37\include -IC:\Python37\include "-IC:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.16.27023\ATLMFC\include" "-IC:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.16.27023\include" "-IC:\Program Files (x86)\Windows Kits\NETFXSDK\4.6.1\include\um" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.17763.0\ucrt" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.17763.0\shared" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.17763.0\um" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.17763.0\winrt" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.17763.0\cppwinrt" /Tcsrc\wrapper.c /Fobuild\temp.win-amd64-3.7\Release\src\wrapper.obj
wrapper.c
src\wrapper.c(3919): warning C4244: '=': conversion from 'Py_ssize_t' to 'int', possible loss of data
src\wrapper.c(4376): warning C4244: '=': conversion from 'Py_ssize_t' to 'int', possible loss of data
src\wrapper.c(11474): error C2039: 'exc_type': is not a member of '_ts'
c:\python37\include\pystate.h(209): note: see declaration of '_ts'
src\wrapper.c(11475): error C2039: 'exc_value': is not a member of '_ts'
c:\python37\include\pystate.h(209): note: see declaration of '_ts'
src\wrapper.c(11476): error C2039: 'exc_traceback': is not a member of '_ts'
c:\python37\include\pystate.h(209): note: see declaration of '_ts'
src\wrapper.c(11488): error C2039: 'exc_type': is not a member of '_ts'
c:\python37\include\pystate.h(209): note: see declaration of '_ts'
src\wrapper.c(11489): error C2039: 'exc_value': is not a member of '_ts'
c:\python37\include\pystate.h(209): note: see declaration of '_ts'
src\wrapper.c(11490): error C2039: 'exc_traceback': is not a member of '_ts'
c:\python37\include\pystate.h(209): note: see declaration of '_ts'
src\wrapper.c(11491): error C2039: 'exc_type': is not a member of '_ts'
c:\python37\include\pystate.h(209): note: see declaration of '_ts'
src\wrapper.c(11492): error C2039: 'exc_value': is not a member of '_ts'
c:\python37\include\pystate.h(209): note: see declaration of '_ts'
src\wrapper.c(11493): error C2039: 'exc_traceback': is not a member of '_ts'
c:\python37\include\pystate.h(209): note: see declaration of '_ts'
src\wrapper.c(11536): error C2039: 'exc_type': is not a member of '_ts'
c:\python37\include\pystate.h(209): note: see declaration of '_ts'
src\wrapper.c(11537): error C2039: 'exc_value': is not a member of '_ts'
c:\python37\include\pystate.h(209): note: see declaration of '_ts'
src\wrapper.c(11538): error C2039: 'exc_traceback': is not a member of '_ts'
c:\python37\include\pystate.h(209): note: see declaration of '_ts'
src\wrapper.c(11539): error C2039: 'exc_type': is not a member of '_ts'
c:\python37\include\pystate.h(209): note: see declaration of '_ts'
src\wrapper.c(11540): error C2039: 'exc_value': is not a member of '_ts'
c:\python37\include\pystate.h(209): note: see declaration of '_ts'
src\wrapper.c(11541): error C2039: 'exc_traceback': is not a member of '_ts'
c:\python37\include\pystate.h(209): note: see declaration of '_ts'
error: command 'C:\\Program Files (x86)\\Microsoft Visual Studio\\2017\\Community\\VC\\Tools\\MSVC\\14.16.27023\\bin\\HostX86\\x64\\cl.exe' failed with exit status 2
我现在真的很困。请帮助:
PyOpenGL
被放弃了吗?
最新的预构建可执行文件可以追溯到Python 3.4时代。那是五年多以前了。为什么这么多年来没有其他更新了?
如何安装PyOpenGL_accelerate
?
我尝试了三种不同的方式来安装此东西。你能帮忙吗?
答案 0 :(得分:0)
我在这里发现了非官方的Windows版本:
https://www.lfd.uci.edu/~gohlke/pythonlibs/#pyopengl
我下载了PyOpenGL-3.1.3b2-cp37-cp37m-win_amd64.whl
和PyOpenGL_accelerate-3.1.3b2-cp37-cp37m-win_amd64.whl
。接下来,我导航到Windows终端中的Downloads
文件夹并开始安装:
C:\Users\Kristof>cd C:\Users\Kristof\Downloads
C:\Users\Kristof\Downloads>pip install PyOpenGL-3.1.3b2-cp37-cp37m-win_amd64.whl
Processing c:\users\kristof\downloads\pyopengl-3.1.3b2-cp37-cp37m-win_amd64.whl
Installing collected packages: PyOpenGL
Successfully installed PyOpenGL-3.1.3b2
C:\Users\Kristof\Downloads>pip install PyOpenGL_accelerate-3.1.3b2-cp37-cp37m-win_amd64.whl
Processing c:\users\kristof\downloads\pyopengl_accelerate-3.1.3b2-cp37-cp37m-win_amd64.whl
Installing collected packages: PyOpenGL-accelerate
Successfully installed PyOpenGL-accelerate-3.1.3b2
感谢@Christoph Gohlke维护了这些构建!