首页 > 解决方案 > TypeError:类型“types.GenericAlias”不是可接受的基本类型

问题描述

好的,所以我将我的 python 项目编译成一个可执行文件,它可以在我的计算机上运行,​​但我将它发送给几个朋友进行测试,他们都得到了这个错误。我以前从未见过这样的错误。我使用 Nuitka 编译代码。

Traceback (most recent call last):   File "C:\Python39\lib\inspect.py", line 35, in <module>
import ast   File "C:\Python39\lib\ast.py", line 29, in <module>
from contextlib import contextmanager, nullcontext   File "C:\Python39\lib\contextlib.py", line 4, in <module>
import _collections_abc   File "C:\Python39\lib_collections_abc.py", line 416, in <module>
class _CallableGenericAlias(GenericAlias): TypeError: type 'types.GenericAlias' is not an acceptable base type`

标签: pythonpython-3.9nuitka

解决方案


推荐阅读