版本名称“cp27"或“cp35"在 Python 中是什么意思? [英] What does version name 'cp27' or 'cp35' mean in Python?

查看:47
本文介绍了版本名称“cp27"或“cp35"在 Python 中是什么意思?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

版本名称cp27"或cp35"在 Python 中是什么意思?

喜欢

我在 64 位 Window 7 PC 上使用 Python 2.7,但不知道我应该安装哪个版本的 Python 包.

三个问题:

  1. gensim-0.12.4-cp27-none-win_amd64.whl"或gensim-0.12.4.win-amd64-py2.7.exe"中的哪个" 我应该安装吗?我已经在我正在使用的 64 位 Window 7 PC 上安装了WinPython-64bit-2.7.10.3".

  2. cp27"在 Python 或 Python 版本名称中是什么意思?我在网上搜索关键字Python cp27",但没有找到任何答案.

  3. 这两个版本的python包有区别吗?('0.12.4-cp27-none-win_amd64' 和 'win-amd64-py2.7') 如果有,有什么区别?

解决方案

如果您查看 Python 增强提案(通常称为 PEP),您会看到 cpN 指的是 Python 的特定版本

gensim-0.12.4-cp27-none-win_amd64.whl 中你可以把它拆开:

  • 0.12.4 - 包版本,他们可能使用语义版本控制
  • cp27 - 此包适用于 CPython.IronPython、Jython 或 PyPy 可能会不高兴.
  • none - 此包的任何功能都不依赖于 python 应用程序二进制接口,或 ABI
  • win_amd64 - 已为 64 位 Windows 编译.这意味着它可能有一些用 C/C++ 编写的代码
  • .whl - 这意味着这是一个轮子分布.这很方便,因为这意味着如果您在 Windows 上运行 CPython 2.7 64 位,并且假设您已经安装了 pip,那么您需要做的就是运行这个包: py -2.7 -m pip install --use-wheel gensim(当然,假设它在 pypi 上可用).您可能需要先py -2.7 -m pip install wheel.但除此之外,仅此而已.

What does version name 'cp27' or 'cp35' mean in Python?

Like the files in https://pypi.python.org/pypi/gensim#downloads

I am using Python 2.7 on a 64-bit Window 7 PC, and don't know which version of python package I should install.

There are three questions:

  1. Which of "gensim-0.12.4-cp27-none-win_amd64.whl" or "gensim-0.12.4.win-amd64-py2.7.exe" should I install? I have installed 'WinPython-64bit-2.7.10.3' on 64-bit Window 7 PC which I am using.

  2. What does 'cp27' mean in Python or Python version name? I searched online with keywords 'Python cp27' but failed to find any answers.

  3. Are there differences between these two versions of python packages? ('0.12.4-cp27-none-win_amd64' and 'win-amd64-py2.7') If there are, what are the differences?

解决方案

If you check out the Python Enhancement Proposal (more commonly known as a PEP), you'll see that the cpN refers to the particular version of Python

in gensim-0.12.4-cp27-none-win_amd64.whl you can break it apart:

  • 0.12.4 - package version, they may be using semantic versioning
  • cp27 - this package is for CPython. IronPython, Jython, or PyPy will probably be unhappy.
  • none - no feature of this package depends on the python Application Binary Interface, or ABI
  • win_amd64 - this has been compiled for 64-bit Windows. That means that it probably has some code written in C/C++
  • .whl - that means this is a wheel distribution. Which is handy, because it means if you're running CPython 2.7 64-bit on Windows, and assuming you have pip installed, all you have to do to get this package is run: py -2.7 -m pip install --use-wheel gensim (assuming that it's available on pypi, of course). You may need to py -2.7 -m pip install wheel first. But other than that, that should be all it takes.

这篇关于版本名称“cp27"或“cp35"在 Python 中是什么意思?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆