How to compile pycrypto 2.4.1 (python 3.2.2 for Windows 7 x64)
How to compile pycrypto 2.4.1 (python 3.2.2 for Windows 7 x64)
Posted by alesk
This note is a variation of note that talks about compiling cx_Oracle module for python 3.2 (64-bit), but this time around I wanted to try out pycrypto module v2.4.1 that supports python 3. Let me say that I first tried to build pycrypto with MinGW using TLDR experimental installation package for Windows x64. Making long story short, it was a bummer (I hit several errors that I didn’t know how to resolve), I didn’t even try if 32-bit module could be compiled with MinGW. Anyway, I believe sticking with VC 2008 and bulky SDK (over 5GB of installed SW!) is inevitable, at least for me. Here’re the steps that I followed….
My target platform for the pycrypto build was Windows 7 Professional x64 (SP1) with 64-bit python 3.2.2.
1) Download and install Visual Studio Express 2008 SP1 from MS site
It’s mandatory to build python modules with VC 2008, because this is the compiler that was used
to build python 3.2. Note that I installed default components of Visual Studio 2008 in default location.
2) Because Visual Studio Express 2008 SP1 doesn’t ship with 64-bit compiler, download
and install Windows SDK for Windows 7 and .NET 3.5 SP1.
Again, don’t be tempted to install newer Windows SDK for Windows 7 and .NET 4, it must be older SDK (released in 2009). I left all installation options at default.
3) Download and install 64-bit python 3.2.2
Ok, this is obvious step. :-)
4) Download pycrypto 2.4.1
After you download unzip pycrypto-2.4.1.tar.gz in some temporary directory, such as C:\Temp
5) Prepare command shell for 64-bit compiler:
Start -> Run
%comspec% /k ""C:\Program Files (x86)\Microsoft Visual Studio 9.0\VC\bin\vcvars64.bat""
Then enter the following on the command line:
SET PATH=C:\PYTHON32;%PATH%
SET PYTHONHOME=C:\Python32\
cd C:\Temp\pycrypto-2.4.1
python setup.py build
python setup.py bdist_wininst
In dist directory you’ll find installation file:
pycrypto-2.4.1.win-amd64-py3.2.exe
After you install pycrypto, check that it works:
cmd> python
>>> import Crypto
>>> print(Crypto.__version__)
2.4.1
How to compile pycrypto 2.4.1 (python 3.2.2 for Windows 7 x64)的更多相关文章
- Compile Graphics Magick, Boost, Botan and QT with MinGW64 under Windows 7 64
Compile Graphics Magick, Boost, Botan and QT with MinGW64 under Windows 7 64 Sun, 01/01/2012 - 15:43 ...
- python使用wmi模块获取windows下的系统信息监控系统-乾颐堂
Python用WMI模块获取Windows系统的硬件信息:硬盘分区.使用情况,内存大小,CPU型号,当前运行的进程,自启动程序及位置,系统的版本等信息. 本文实例讲述了python使用wmi模块获取w ...
- 【selenium+python】之Python Flask 开发环境搭建(Windows)
一.先安装python以及pip 二.其次, Python的虚拟环境安装: 在github上下载https://github.com/pypa/virtualenv/tree/master zip文 ...
- Python 编程环境搭建(Windows 系统中)
由于大家普遍使用 Windows 系统,所以本文只介绍 Windows 系统中 Python 环境的安装. 在 Windows 中安装 Python 与安装普通软件没什么差别,下载所需版本的安装包后, ...
- 源码编译vi过程中进行配置时报“checking if compile and link flags for Python are sane... no: PYTHON DISABLED”怎么办?
答: 需要安装python开发库(如果不安装这个库,那么在配置时执行./configure --enable-pythoninterp=yes将不会生效,以至于vi的python特性并没有被开启) 如 ...
- Python安装BeautifulSoup库(Windows平台下)
简介 参照官网Beautiful Soup4.4.0文档:https://www.crummy.com/software/BeautifulSoup/bs4/doc/ 安装步骤 1.到https:// ...
- 如何解决Python脚本在Linux和Windows上的格式问题
python是一种对缩进有严格要求的语言, Python脚本可以使用非常多的工具进行编写,笔者在Linux系统使用JEdit进行Python脚本编写,由于在Linux编写脚本比较痛苦,比如想一眼看出相 ...
- 用python来更改小伙伴的windows开机密码,不给10块不给开机
今天教大家用python脚本来控制小伙伴们windows电脑的开机密码.没错就是神不知鬼不觉,用random()随机生成的密码,只有你自己知道哦~ 代码呢分两部分,一部分是client端跟serv ...
- python安装MySQLdb:在windows下或linux下(以及eclipse中pydev使用msqldb的配置方法)
写的非常好,可以解决问题: windows下:http://blog.csdn.net/wklken/article/details/7253245 linux下:http://blog.csdn.n ...
随机推荐
- JavaScript符串中每个单词的首字母大写化
map() + replace() function titleCase(str) { var convertToArray = str.toLowerCase().split(" &quo ...
- wpf采用Xps实现文档显示、套打功能(原创)
近期的一个项目需对数据进行套打,用户要求现场不允许安装office.页面预览显示必须要与文档完全一致,xps文档来对数据进行处理.Wpf的DocumentView 控件可以直接将数据进行显示,xps也 ...
- 【转】oracle Sequence
http://blog.csdn.net/zhoufoxcn/article/details/1762351 在oracle中sequence就是序号,每次取的时候它会自动增加.sequence与表没 ...
- 如何用angularjs制作一个完整的表格之三__在ng-repeat中使用ng-model
在ng-repeat中使用ng-model时会有许多问,有的人碰到无法获取绑定的数据内容,有的人遇到改动绑定的数据内容时所有循环生成的内容一起改变.上面的问题我在开发时也遇到过,但是解决后我却怎么也还 ...
- CSS 响应式设计
响应式设计是指在不同分辨率的设备中,网页布局可以自适应的调整.这种弹性化的布局使网站在不同设备中的布局都比较合理,可以为不同终端的用户提供更加舒适的界面和更好的用户体验,其根本理念是使原本 PC 上的 ...
- Docker 安装jupyter notebook
1. 利用image运行一个container sudo docker run -it --net=host tingting --net=host:让container可以上网,安装原来的sudo ...
- bzoj 2244: [SDOI2011]拦截导弹 cdq分治
2244: [SDOI2011]拦截导弹 Time Limit: 30 Sec Memory Limit: 512 MBSec Special JudgeSubmit: 237 Solved: ...
- 安装ECMall后报PHP Strict Standards错误,请问如何解决
Strict Standards: Non-static method ECMall::startup() should not be called statically in /htdocs/ecm ...
- 【网络流24题】No. 13 星际转移问题 (网络判定 最大流)
[题意] 由于人类对自然资源的消耗, 人们意识到大约在 2300 年之后, 地球就不能再居住了.于是在月球上建立了新的绿地,以便在需要时移民. 令人意想不到的是, 2177 年冬由于未知的原因, 地球 ...
- [转贴]JAVA 百度地图SDK地图学习——实现定位功能
之前已经完成了百度地图SDK和百度定位SDK的配置. http://my.oschina.net/u/1051634/blog/180880 实现百度定位的功能,最好仔细看看官方的文档,看了好几次才有 ...