python - 如何确定某个库(例如 pypi.org 上的库)是否适合 Python 3

标签 python

这是一个通用问题,但例如,我发现 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/

相关文章:

python - Selenium 和Python : what is the correct way to define WebElement as property

python - Pandas 缩编持续时间

python - 如何让 LaTeX 代码按字面意义存储在 Python 中?

python - 列出 Django 中的所有静态 Assets

Mako 模板中的 Python 函数(不在模块级 block 中)

python - 复制枚举函数的功能而不使用它

python - level必须是整数,elasticsearch报错

python - 使用 Heroku 部署时如何解决 "' django_content_type' does not exit” 错误?

python - 如何创建可定制的 Python 类型

python - 为什么我们需要在 Huggingface Transformers 的 BERT 预训练模型中使用 init_weight 函数?