Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/python/348.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

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/python-3.x/15.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 3.6.4 Arcade模块窗口错误?{pyglet.gl.lib.GLException:b';无效枚举器';}_Python_Python 3.x_Exception_Window - Fatal编程技术网

Python 3.6.4 Arcade模块窗口错误?{pyglet.gl.lib.GLException:b';无效枚举器';}

Python 3.6.4 Arcade模块窗口错误?{pyglet.gl.lib.GLException:b';无效枚举器';},python,python-3.x,exception,window,Python,Python 3.x,Exception,Window,更新: # import needed modules import random import arcade arcade.open_window(800, 600,'most awesome nothing', False) arcade.set_background_color(arcade.color.BLUE) arcade.start_render() python = arcade.Sprite(r"C:\Users\The Cube\Desktop\STUDENT FILES

更新:

# import needed modules
import random
import arcade

arcade.open_window(800, 600,'most awesome nothing', False)
arcade.set_background_color(arcade.color.BLUE)
arcade.start_render()

python = arcade.Sprite(r"C:\Users\The Cube\Desktop\STUDENT FILES\Python Game Projects - Teens\diamond.png")

python.center_x = 200
python.center_y = 200
python.draw()

arcade.finish_render()
arcade.run()
Python 3.6.4 (v3.6.4:d48eceb, Dec 19 2017, 06:04:45) [MSC v.1900 32 bit (Intel)] on win32
Type "copyright", "credits" or "license()" for more information.
>>> 
 RESTART: C:\Users\The Cube\Desktop\STUDENT FILES\Python Game Projects - Teens\phoenix is a cool cat.py 
Traceback (most recent call last):
  File "C:\Users\The Cube\Desktop\STUDENT FILES\Python Game Projects - Teens\phoenix is a cool cat.py", line 5, in <module>
    arcade.open_window(800, 600,'most awesome nothing', False)
  File "C:\Users\The Cube\AppData\Local\Programs\Python\Python36-32\lib\site-packages\arcade\application.py", line 384, in open_window
    _window = Window(width, height, window_title, resizable, update_rate=None)
  File "C:\Users\The Cube\AppData\Local\Programs\Python\Python36-32\lib\site-packages\arcade\application.py", line 56, in __init__
    gl.glEnable(gl.GL_MULTISAMPLE_ARB)
  File "C:\Users\The Cube\AppData\Local\Programs\Python\Python36-32\lib\site-packages\pyglet\gl\lib.py", line 105, in errcheck
    raise GLException(msg)
pyglet.gl.lib.GLException: b'invalid enumerant'
>>> 
我检查了电脑上安装的显卡

它“工作”的一个有Nvidia图形,另一个在设备管理器的显示适配器下有Intel HD R图形。我假设Intel HD R图形驱动程序不够(不包含所需的OpenGL?)

要使arcade模块正常工作,我需要在Intel HD R图形计算机上安装什么

原始问题:

# import needed modules
import random
import arcade

arcade.open_window(800, 600,'most awesome nothing', False)
arcade.set_background_color(arcade.color.BLUE)
arcade.start_render()

python = arcade.Sprite(r"C:\Users\The Cube\Desktop\STUDENT FILES\Python Game Projects - Teens\diamond.png")

python.center_x = 200
python.center_y = 200
python.draw()

arcade.finish_render()
arcade.run()
Python 3.6.4 (v3.6.4:d48eceb, Dec 19 2017, 06:04:45) [MSC v.1900 32 bit (Intel)] on win32
Type "copyright", "credits" or "license()" for more information.
>>> 
 RESTART: C:\Users\The Cube\Desktop\STUDENT FILES\Python Game Projects - Teens\phoenix is a cool cat.py 
Traceback (most recent call last):
  File "C:\Users\The Cube\Desktop\STUDENT FILES\Python Game Projects - Teens\phoenix is a cool cat.py", line 5, in <module>
    arcade.open_window(800, 600,'most awesome nothing', False)
  File "C:\Users\The Cube\AppData\Local\Programs\Python\Python36-32\lib\site-packages\arcade\application.py", line 384, in open_window
    _window = Window(width, height, window_title, resizable, update_rate=None)
  File "C:\Users\The Cube\AppData\Local\Programs\Python\Python36-32\lib\site-packages\arcade\application.py", line 56, in __init__
    gl.glEnable(gl.GL_MULTISAMPLE_ARB)
  File "C:\Users\The Cube\AppData\Local\Programs\Python\Python36-32\lib\site-packages\pyglet\gl\lib.py", line 105, in errcheck
    raise GLException(msg)
pyglet.gl.lib.GLException: b'invalid enumerant'
>>> 
遇到了一个非常奇怪的问题,我写的python代码在一台计算机上工作,但在另一台计算机上却不工作,我不知道为什么

我在两台计算机上都安装了Python 3.6.4。 任何3.6+版本都应该能够运行Arcade模块

这是我的代码,非常简单:

# import needed modules
import random
import arcade

arcade.open_window(800, 600,'most awesome nothing', False)
arcade.set_background_color(arcade.color.BLUE)
arcade.start_render()

python = arcade.Sprite(r"C:\Users\The Cube\Desktop\STUDENT FILES\Python Game Projects - Teens\diamond.png")

python.center_x = 200
python.center_y = 200
python.draw()

arcade.finish_render()
arcade.run()
Python 3.6.4 (v3.6.4:d48eceb, Dec 19 2017, 06:04:45) [MSC v.1900 32 bit (Intel)] on win32
Type "copyright", "credits" or "license()" for more information.
>>> 
 RESTART: C:\Users\The Cube\Desktop\STUDENT FILES\Python Game Projects - Teens\phoenix is a cool cat.py 
Traceback (most recent call last):
  File "C:\Users\The Cube\Desktop\STUDENT FILES\Python Game Projects - Teens\phoenix is a cool cat.py", line 5, in <module>
    arcade.open_window(800, 600,'most awesome nothing', False)
  File "C:\Users\The Cube\AppData\Local\Programs\Python\Python36-32\lib\site-packages\arcade\application.py", line 384, in open_window
    _window = Window(width, height, window_title, resizable, update_rate=None)
  File "C:\Users\The Cube\AppData\Local\Programs\Python\Python36-32\lib\site-packages\arcade\application.py", line 56, in __init__
    gl.glEnable(gl.GL_MULTISAMPLE_ARB)
  File "C:\Users\The Cube\AppData\Local\Programs\Python\Python36-32\lib\site-packages\pyglet\gl\lib.py", line 105, in errcheck
    raise GLException(msg)
pyglet.gl.lib.GLException: b'invalid enumerant'
>>> 
在一台计算机上工作正常,但在另一台计算机上,我发现以下错误:

代码格式:

# import needed modules
import random
import arcade

arcade.open_window(800, 600,'most awesome nothing', False)
arcade.set_background_color(arcade.color.BLUE)
arcade.start_render()

python = arcade.Sprite(r"C:\Users\The Cube\Desktop\STUDENT FILES\Python Game Projects - Teens\diamond.png")

python.center_x = 200
python.center_y = 200
python.draw()

arcade.finish_render()
arcade.run()
Python 3.6.4 (v3.6.4:d48eceb, Dec 19 2017, 06:04:45) [MSC v.1900 32 bit (Intel)] on win32
Type "copyright", "credits" or "license()" for more information.
>>> 
 RESTART: C:\Users\The Cube\Desktop\STUDENT FILES\Python Game Projects - Teens\phoenix is a cool cat.py 
Traceback (most recent call last):
  File "C:\Users\The Cube\Desktop\STUDENT FILES\Python Game Projects - Teens\phoenix is a cool cat.py", line 5, in <module>
    arcade.open_window(800, 600,'most awesome nothing', False)
  File "C:\Users\The Cube\AppData\Local\Programs\Python\Python36-32\lib\site-packages\arcade\application.py", line 384, in open_window
    _window = Window(width, height, window_title, resizable, update_rate=None)
  File "C:\Users\The Cube\AppData\Local\Programs\Python\Python36-32\lib\site-packages\arcade\application.py", line 56, in __init__
    gl.glEnable(gl.GL_MULTISAMPLE_ARB)
  File "C:\Users\The Cube\AppData\Local\Programs\Python\Python36-32\lib\site-packages\pyglet\gl\lib.py", line 105, in errcheck
    raise GLException(msg)
pyglet.gl.lib.GLException: b'invalid enumerant'
>>> 
win32上的Python 3.6.4(v3.6.4:d48eceb,2017年12月19日,06:04:45)[MSC v.1900 32位(英特尔)] 有关详细信息,请键入“copyright”、“credits”或“license()”。 >>> 重启:C:\Users\thecube\Desktop\STUDENT FILES\Python游戏项目-teents\phoenix是一个很酷的cat.py 回溯(最近一次呼叫最后一次): 文件“C:\Users\The Cube\Desktop\STUDENT FILES\Python Game Projects-teents\phoenix是一个很酷的cat.py”,第5行,在 拱廊。打开窗户(800600,“最棒的没有”,假) 文件“C:\Users\The Cube\AppData\Local\Programs\Python\Python36-32\lib\site packages\arcade\application.py”,第384行,在open\u窗口中 _窗口=窗口(宽度、高度、窗口标题、可调整大小、更新率=无) 文件“C:\Users\The Cube\AppData\Local\Programs\Python\Python36-32\lib\site packages\arcade\application.py”,第56行,在uu init中__ glEnable总帐(多样本总帐) 文件“C:\Users\The Cube\AppData\Local\Programs\Python\Python36-32\lib\site packages\pyglet\gl\lib.py”,第105行,错误检查 引发异常(msg) pyglet.gl.lib.GLException:b'invalid enumerant' >>> 屏幕截图:

问题:为什么它在一台计算机上工作而在另一台计算机上不工作?


任何帮助都将不胜感激。谢谢大家!

这行代码支持OpenGL多采样。这是消除混叠所必需的。图形卡/驱动程序组合似乎不支持该选项

您可以使用
抗锯齿=False
创建arcade.Window实例,但遗憾的是,您正在使用的
打开\u Window
命令在2.0.1中不支持该命令

如果不支持多重采样,则问题已被打开以正常降级: