今天需要测试C#调用Python应用程序,打包一直报错,无法测试验证,之前很容导报成功的且,创建了很多的exe应用。
报错的关键信息如下:
AttributeError: type object ‘Callable’ has no attribute ‘_abc_registry’
pre-safe-import-module hook failed, needs fixing.
解决方式:
键盘 win+R 键,输入cmd
在弹出窗口输入:pip uninstall typing
卸载 typing,提示是否卸载,输入y.
Found existing installation: typing 3.7.4.3
Uninstalling typing-3.7.4.3:
Would remove:
c:\users\ritchie.li\appdata\local\programs\python\python39\lib\site-packages\typing-3.7.4.3-py3.9.egg-info
c:\users\ritchie.li\appdata\local\programs\python\python39\lib\site-packages\typing.py
Proceed (Y/n)? y
Successfully uninstalled typing-3.7.4.3
卸载成功后,在使用pyintsaller 打包OK。