Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/python/359.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Python OpenGL GLUT运行异常_Python_Opengl_Glut - Fatal编程技术网

Python OpenGL GLUT运行异常

Python OpenGL GLUT运行异常,python,opengl,glut,Python,Opengl,Glut,我一直在制作一个库,在其中,我使用GLUT作为窗口提供者。我试图把窗户放在某个地方,但当我使用cython时,有些东西表现得很滑稽。这是我的密码: from OpenGL import GLUT as glut glut.glutInit() glut.glutInitWindowPosition(glut.glutGet(glut.GLUT_SCREEN_WIDTH) // 2 - 100, 50) 仅使用这些代码行,我就使用了命令cythonize-3-I test.py,当我导入测试时

我一直在制作一个库,在其中,我使用GLUT作为窗口提供者。我试图把窗户放在某个地方,但当我使用cython时,有些东西表现得很滑稽。这是我的密码:

from OpenGL import GLUT as glut

glut.glutInit()
glut.glutInitWindowPosition(glut.glutGet(glut.GLUT_SCREEN_WIDTH) // 2 - 100, 50)
仅使用这些代码行,我就使用了命令
cythonize-3-I test.py
,当我导入测试时,我就出现了一个错误:

Python 3.8.2 (tags/v3.8.2:7b3ab59, Feb 25 2020, 22:45:29) [MSC v.1916 32 bit (Intel)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> import test
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ImportError: DLL load failed while importing test: The specified module could not be found.
>>>
我知道这在技术上是不可能的,但它仍然会引发错误。删除任何部分(包括
//2
部分)不会引发错误

注意:这只发生在一台机器上,而不是另一台机器上,我不知道为什么。我在这两台计算机上都有相同的设置,除了第一台使用MSVC(工作),第二台使用MinGW(不工作)。我试着在第一台电脑上使用MinGW,但效果很好,所以可能和第二台电脑有关


注2:没关系,我想这是因为我使用了MinGW,但在第一台计算机上它与
setup.py
一起工作,但在第二台计算机上,无论我做什么,它都不工作。

这与我使用
cythonize
命令有关吗?
from OpenGL import GLUT as glut

glut.glutInitWindowPosition(glut.glutGet(glut.GLUT_SCREEN_WIDTH) // 2)