通过 pip 为 python 2.7 安装 py2exe:此包需要 Python 3.3 或更高版本

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/23734172/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-19 03:24:47  来源:igfitidea点击:

Install py2exe for python 2.7 over pip: this package requires Python 3.3 or later

pythonpython-2.7pippy2exepypi

提问by Bruno Gelb

>>> python -c "import sys; print sys.version"
2.7.6 (default, Nov 10 2013, 19:24:18) [MSC v.1500 32 bit (Intel)]

>>> pip --version
pip 1.5.5 from C:\Python27\lib\site-packages (python 2.7)

>>> pip install py2exe
<mumble grumble..>
RuntimeError: This package requires Python 3.3 or later

though official py2exe download pagesays they have exactly what I need:

虽然官方py2exe 下载页面说他们有我需要的东西:

screenshot

截屏

So how to install py2exe over pip?

那么如何通过pip安装py2exe呢?

采纳答案by Padraic Cunningham

It is missing from pypi, if you click on the 0.6.9link it brings you to the 0.9.2.0python 3 package, there seems to be no 0.6.9package available to download.

pypi中缺少它,如果您单击0.6.9它带您到0.9.2.0python 3 包的链接,似乎没有0.6.9可供下载的包。

Try using pip install http://sourceforge.net/projects/py2exe/files/latest/download?source=files

尝试使用 pip install http://sourceforge.net/projects/py2exe/files/latest/download?source=files

回答by vk1011

There is also a wheel of py2exeavailable for Python 2.x: py2exe_py2 0.6.9

还有一个py2exe可用于 Python 2.x的轮子:py2exe_py2 0.6.9

You can do: pip install py2exe_py2

你可以做: pip install py2exe_py2

Pypilink.

pypi链接。

回答by Thomas

you can directly download py2exe for python 2.7 from here

你可以直接从这里下载 py2exe for python 2.7

回答by There

You may try using pip3. Or if pip3 is not installed or not found, try: python3 -m pip install py2exe.

您可以尝试使用 pip3。或者,如果PIP3没有安装或没有找到,试试:python3 -m pip install py2exe

Source: https://superuser.com/a/942338/315157

来源:https: //superuser.com/a/942338/315157

回答by scruel

I'm using Anacona, and I install py2.7 via its environments feature, so previous answers were not helpful to me.

我正在使用 Anacona,我通过它的环境功能安装了 py2.7,所以以前的答案对我没有帮助。

--------------------------- Cannot install ---------------------------  
Python version 2.7 required, which was not found in the registry. 

The following is the command I used, it can install py2exe via command line.

以下是我使用的命令,它可以通过命令行安装py2exe。

pip install https://nchc.dl.sourceforge.net/project/py2exe/py2exe/0.6.9/py2exe-0.6.9.zip
...
Successfully installed py2exe-0.6.9

Cause py2exe requires Microsoft Visual C++ 9.0, so before installing, you should download and install it, by convenience, via this link

因为py2exe需要Microsoft Visual C++ 9.0,所以在安装之前,你应该下载并安装它,方便起见,通过这个链接

Hope this could be helpful, Thx.

希望这会有所帮助,谢谢。