这是一个通用问题,但例如,我发现 pyxser我想知道它是否适用于 Python 3。今天早些时候我浪费了 15-20 分钟找出“Gnosis” ' 不是。
我看到这个特定包裹上的日期是 2011 年 3 月,所以我猜不是。
pypi.org 上的所有内容都是古老的吗?有更好的网站可以使用吗?
基本上,我们都会在 Google 上搜索“Python 的 xml 序列化器”之类的内容,然后得到 Python 2 和 3 库的混合体。
这是一个没有答案的类似问题:Determining for which python version a library is designed
但关键是我们需要一种技术来找出任何库与其兼容的版本。
最佳答案
Is everything on pypi.org ancient?
没有。
Is there a better site to use?
没有。
But the point is we need have a technique to find out for any library what releases it is compatible with.
任何库都没有这样的技术,但许多库都会有:
语言 classifiers在 PyPI 上 - 具体来说,以“Programming Language::Python::”开头的内容在这里很有帮助,“Programming Language::Python::3”表示支持 Python 3,“Programming Language::Python::2::”表示支持。仅”表明缺乏它。 (有关示例,请参阅 https://pypi.org/project/lxml/ 的侧边栏。)
python_requires
,PyPI 也会显示轮子在“下载文件”页面中指示 Python 版本。
cp3<i>x</i>
是 CPython 3.x 的轮子,再次表明 Python 3 支持。 (此示例位于 https://pypi.org/project/lxml/#files 。)
关于python - 如何确定某个库(例如 pypi.org 上的库)是否适合 Python 3,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/62604061/