win7下编译python源码
2015-08-10 10:58
615 查看
win7下编译python源码
下载源码:
打开网页:https://www.python.org/downloads/release/python-2710/下载完成后解压即可
查看文档:
其实最最可利用的资源是官方的文档,我们进入到PCbuild目录下,打开readme.txt,这里介绍了如何编译python源码以及所需要的环境等。his directory is used to build Python for Win32 and x64 platforms, e.g.
Windows 2000, XP, Vista and Windows Server 2008. In order to build 32-bit
debug and release executables, Microsoft Visual C++ 2008 Express Edition is
required at the very least. In order to build 64-bit debug and release
executables, Visual Studio 2008 Standard Edition is required at the very
least. In order to build all of the above, as well as generate release builds
that make use of Profile Guided Optimisation (PG0), Visual Studio 2008
Professional Edition is required at the very least. The official Python
releases are built with this version of Visual Studio.
vs2008是所需的最低的版本,我们这里使用vs2012完全是可以的。
You can find build directories for older versions of Visual Studio and
Visual C++ in the PC directory. The legacy build directories are no longer
actively maintained and may not work out of the box.
PC/VC6/
Visual C++ 6.0
PC/VS7.1/
Visual Studio 2003 (7.1)
PC/VS8.0/
Visual Studio 2005 (8.0)
你也可以使用更早的版本来编译,这样的话你需要到PC目录下找到相对应的源码
配置环境:
使用vs2012打开PCbuild目录下的 sln文件:打开项目的属性,找到配置那一项,只选择python和pythoncore:
找到下图这两个文件,依次单独编译(选中——>右键 仅用于项目 ——>仅重新生成 ):
编译运行:
最后在总工程上右键选择生成解决方案就可以编译成功了。在当然目录下会生成一些文件,如图:我们从控制台进入当前目录运行python_d.exe就可以了,如图:
相关文章推荐
- 关于Windows系统下,Python读取文件的问题。
- win32下利用python操作printer
- Python Paste.deploy 笔记
- python 清理mail spool 下的小脚本
- 递归
- 你也可以有自己的天气预报啦!
- 0.python基本算法
- Solaris 10u11 安装python2.7.10
- python--获取网页图片
- python列表排序
- Python之Window环境搭建
- Python于*args 和**kwargs使用
- 零基础学python-1.6 错误的程序
- 零基础学python-1.6 错误的程序
- 正则匹配不包含某字符串(Python)
- 使用python执行复制时遇到的一点问题
- [译] 12步轻松搞定python装饰器 - 简书
- python实现爬取千万淘宝商品的方法_python_脚本之家
- 值得关注的10个python语言博客 - WEB开发者
- python - ImportError: No module named pywintypes