简体   繁体   English

导入变形 package 时如何解决此错误?

[英]How can I solve this error while importing inflect package?

I tried to run the code in inflect documentation https://pypi.org/project/inflect/ but I get a value error.我尝试运行 inflect 文档https://pypi.org/project/inflect/中的代码,但出现值错误。

import inflect

p = inflect.engine()

word = 'cat'
cat_count = 10

print("The plural of ", word, " is ", p.plural(word))
print("I saw", cat_count, p.plural("cat", cat_count))

I get the error:我得到错误:

ValueError: `Field` default cannot be set in `Annotated` for 'num_Annotated[str, FieldInfo(min_length=1, extra={})]'

I tried deleting and reinstalling the package but nothing changed.我尝试删除并重新安装 package 但没有任何改变。 How can I solve this?我该如何解决这个问题?

This seems to be a bug with your version ( source ).这似乎是您的版本( source )的错误。

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

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