Python 错误 - 不受支持的类型错误 : item 1 in _argtypes_ passes a union by value,

标签 python tkinter anaconda typeerror pyglet

我认为这不是特定于编程的错误,而是由某些库引起的。

我正在将我的项目转移到一台新 PC,我已经使用 python 3.7.6 用 anaconda 等新设置了它。在旧机器上执行任务工作正常,这里我还使用了 anaconda 和 python 3.7(不确定它是否是 3.7.6 但我可以检查这个,我只是在创建环境 python=3.7 时使用)。

当我现在尝试运行我的程序时,我收到:

Exception in Tkinter callback
Traceback (most recent call last):
...    
TypeError: item 1 in _argtypes_ passes a union by value, which is unsupported.

错误很长,但它是由以下库引起的:
调用gym.envs 然后调用一些pyglet.libs

错误中的最后一行是
...from pyglet.libs.x11 import xlib
  File "...7/lib/python3.7/site-packages/pyglet/libs/x11/xlib.py", line 2928, in <module>
    XEHeadOfExtensionList.argtypes = [XEDataObject]

感谢您的帮助!我不知道如何解决这个问题,甚至不知道如何开始解决。

最佳答案

目前似乎根本不支持在 python 3.7.6+ 版本中使用gym+pyglet。

pyglet 错误已在 1.4.9+ 中修复,但gym 目前与这些版本不兼容。

仍然可以简单地将 python 降级到 3.7.4,并且一切正常。

关于Python 错误 - 不受支持的类型错误 : item 1 in _argtypes_ passes a union by value,,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/59892863/

相关文章:

python - Windows CPU 版本 : ImportError: No module named '_pywrap_tensorflow_internal' 上的 TensorFlow

python - TK : How to remove tk entry if the user inputs anything than strings?

python - 什么时候应该在 Python 中使用 'assert'?

python - Django 1.7 makemigrations 将表重命名为 None

python - Python 3.6 中的 Tkinter : Grid sticky option not working

python - 使用列表作为列表框变量而不是元组

anaconda - Rstudio 不是从 anaconda 启动的

python - 为什么远程部署路径中的 $PATH 与远程系统中的 $PATH 不同?

python - Windows 10 conda 未被识别为内部或外部命令

Python:环境变量未更新