在Windows上编译Python 3.6.9 [英] Compiling Python 3.6.9 on Windows

查看:579
本文介绍了在Windows上编译Python 3.6.9的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试安装Python 3.6.9,但遇到了问题. 首先,我下载了Python-3.6.9-tgz,然后将其提取以获取Python-3.6.9.tar,然后将其提取以获取名为Python-3.6.9的文件夹

I am trying to install Python 3.6.9 and am having problems. First I downloaded Python-3.6.9-tgz, then extracted it to get Python-3.6.9.tar, then extracted that to get a folder called Python-3.6.9

其中包含setup.py.因此,在Windows 10上,我打开命令提示符并导航到该文件夹​​,然后键入:setup.py install.这将打开我已经拥有的Visual Studio,并且什么也不做.请让我知道是否需要做其他事情.

This has setup.py in it. So on windows 10 I opened the command prompt and navigated to that folder and typed: setup.py install. This opens up visual studio that I already have and does nothing. Please let me know if I need to do something else.

我尝试添加环境变量,但没有任何效果.

I tried to add environmental variables but nothing has worked.

推荐答案

首先:您应该真正下载

First of all: You should really just download Python 3.7.4. Python 3.7 is backwards compatible with Python 3.6.

Python 3.6.9发行版是仅安全的发行版,主要针对必须长期支持3.6.x软件包的长期支持Linux发行版.因此,没有提供二进制安装程序,而是希望Windows用户已经升级到3.7.

The Python 3.6.9 release is a security-only release primarily aimed at Long-term-support Linux distributions that must continue to support 3.6.x packages. As such no binary installers are provided, and Windows users are instead expected to have upgraded to 3.7 already.

如果您仍然希望编译Python 3.6.9,则README.rst文件包含Unix,Linux,BSD,macOS和Cygwin的安装说明,而对于Windows,则指向专用文件:

If you still feel you want to compile Python 3.6.9, then the README.rst file includes installation instructions for Unix, Linux, BSD, macOS, and Cygwin, and for Windows points you to a dedicated file:

在Windows上,请参阅PCbuild/readme.txt.

On Windows, see PCbuild/readme.txt.

可在 https://github上在线找到.com/python/cpython/blob/v3.6.9/PCbuild/readme.txt .同一目录中包含一个批处理脚本,该脚本旨在使在Windows上构建Python更加容易.从以上文档中:

which can be found online at https://github.com/python/cpython/blob/v3.6.9/PCbuild/readme.txt. The same directory holds a batch script designed to make building Python easier on Windows. From the above documentation:

使用build.bat脚本构建Python

在此目录中,您可以找到build.bat,该脚本旨在 在Windows上构建Python更简单.该脚本将使用env.bat 脚本以检测Visual Studio 2015、2013、2012或2010中的任何一个 可以用来构建Python,尽管只有Visual Studio 2015是 官方支持.

Building Python using the build.bat script

In this directory you can find build.bat, a script designed to make building Python on Windows simpler. This script will use the env.bat script to detect one of Visual Studio 2015, 2013, 2012, or 2010, any of which may be used to build Python, though only Visual Studio 2015 is officially supported.

默认情况下,build.bat将在Release配置中为以下版本构建Python: 32位Win32平台.它接受改变的几个论点 这种行为,请尝试build.bat -h了解更多信息.

By default, build.bat will build Python in Release configuration for the 32-bit Win32 platform. It accepts several arguments to change this behavior, try build.bat -h to learn more.

setup.py脚本在构建过程中间接使用 .不要自己运行它.

The setup.py script is used indirectly by the build process. Don't run it yourself.

这篇关于在Windows上编译Python 3.6.9的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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