简体   繁体   English

Python edifact 库无法在 Windows 10 上运行

[英]Python edifact library won't work on windows 10

Hello and thanks in advance,您好,提前致谢,

Python is a languge I don't often use but I am interested in an edifact library called pydifact I found on github. Python 是一种我不经常使用的语言,但我对我在 github 上找到的名为pydifact的 edifact 库感兴趣。 I run the example, it runs fine on linux but I get an error on windows 10... I used python 3.10我运行该示例,它在 linux 上运行良好,但在 Windows 10 上出现错误...我使用了 python 3.10

Traceback (most recent call last):
File "C:\Python\testApp.py", line 1, in <module>
from pydifact.segmentcollection import Interchange
File "c:\users\myname\pydifact\pydifact\__init__.py", line 23, in <module>
from pydifact import segmentcollection, parser, segments, serializer, token, 
tokenizer
File "c:\users\myname\pydifact\pydifact\segmentcollection.py", line 339, in <module>
class Interchange(FileSourcableMixin, UNAHandlingMixin, AbstractSegmentsContainer):
File "c:\users\myname\pydifact\pydifact\segmentcollection.py", line 425, in Interchange
cls, segments: Union[list, collections.Iterable]
AttributeError: module 'collections' has no attribute 'Iterable'

Any thoughts?有什么想法吗?

The line线

cls, segments: Union[list, collections.Iterable]

which the error message mentions, indicates, that Iterable is not in collections module.错误消息提到,表明Iterable不在collections模块中。 Python deprecated colections.<smth> in favor of collections.abc.<smth> since version 3.3.自 3.3 版起,Python 弃用了colections.<smth>以支持collections.abc.<smth> Since 3.10 this deprecated behaviour is completely dropped and raises an error.自 3.10 起,此弃用行为已完全删除并引发错误。

So, you should downgrade to python 3.9 or eariler or replace all occurences of因此,您应该降级到 python 3.9 或早期版本或替换所有出现的

collections.Iterable

to

collections.abc.Iterable

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM