- 浏览: 571138 次
- 性别:
- 来自: 北京
-
文章分类
- 全部博客 (618)
- java (109)
- Java web (43)
- javascript (52)
- js (15)
- 闭包 (2)
- maven (8)
- 杂 (28)
- python (47)
- linux (51)
- git (18)
- (1)
- mysql (31)
- 管理 (1)
- redis (6)
- 操作系统 (12)
- 网络 (13)
- mongo (1)
- nginx (17)
- web (8)
- ffmpeg (1)
- python安装包 (0)
- php (49)
- imagemagic (1)
- eclipse (21)
- django (4)
- 学习 (1)
- 书籍 (1)
- uml (3)
- emacs (19)
- svn (2)
- netty (9)
- joomla (1)
- css (1)
- 推送 (2)
- android (6)
- memcached (2)
- docker、 (0)
- docker (7)
- go (1)
- resin (1)
- groovy (1)
- spring (1)
最新评论
-
chokee:
...
Spring3 MVC 深入研究 -
googleyufei:
很有用, 我现在打算学学Python. 这些资料的很及时.
python的几个实用网站(转的) -
hujingwei1001:
太好了找的就是它
easy explore -
xiangtui:
例子举得不错。。。学习了
java callback -
幻影桃花源:
太好了,謝謝
Spring3 MVC 深入研究
Compiling Python 2.7 Modules on Windows 32 and 64 using MSVC++ 2008 Express
Hello,
On this post i will explain how to build, compile, install and distribute python modules on Windows using Microsoft Visual C++ Express Edition.
This post will be constantly updated to cover future updates of python, windows and msvc++ versions.
For this example i will use the PyCrypto – http://pycrypto.org because this is an example that don’t have packages for windows x64 on the web.
Observation: Don’t use Microsoft Visual C++ Express Edition 2010 to build python modules, because this will not work due to Python 2.7 was built using the 2008 version. This is an error that occurs when you try to build PyCrypto and Paramiko using the 2010 version and execute the import module:
>>> import paramiko Traceback (most recent call last): File "<stdin>", line 1, in <module> File "C:\Python27\lib\site-packages\paramiko\__init__.py", line 69, in <module> from transport import SecurityOptions, Transport File "C:\Python27\lib\site-packages\paramiko\transport.py", line 32, in <module> from paramiko import util File "C:\Python27\lib\site-packages\paramiko\util.py", line 32, in <module> from paramiko.common import * File "C:\Python27\lib\site-packages\paramiko\common.py", line 98, in <module> from Crypto import Random File "C:\Python27\lib\site-packages\Crypto\Random\__init__.py", line 28, in <module> import OSRNG File "C:\Python27\lib\site-packages\Crypto\Random\OSRNG\__init__.py", line 34, in <module> from Crypto.Random.OSRNG.nt import new File "C:\Python27\lib\site-packages\Crypto\Random\OSRNG\nt.py", line 28, in <module> import winrandom ImportError: DLL load failed: The specified module could not be found.
1 – Building and Installing PyCrypto Module for Windows 7 64 bits:
1.1 - You must have installed the Python 64 bits version: http://www.python.org/ftp/python/2.7.1/python-2.7.1.amd64.msi
1.2 - You should install the C Compiler for Windows – Microsoft Visual C++ Express Edition 2008 : available here:http://www.microsoft.com/express/Downloads/#Visual_Studio_2008_Express_Downloads
ISO File to Download: http://www.microsoft.com/express/Downloads/#2008-All
1.3 - You should install the Microsoft Windows SDK for Windows 7 and .NET Framework 3.5 SP1 : available here:http://www.microsoft.com/downloads/en/details.aspx?FamilyID=c17ba869-9671-4330-a63e-1fd44e0e2505
ISO File To Download (64 bits): http://download.microsoft.com/download/2/E/9/2E911956-F90F-4BFB-8231-E292A7B6F287/GRMSDKX_EN_DVD.iso
This is required because the Express Edition 2008 C++ don’t contains the 64 bits compiler. This is required only for Windows 7 64 bits version.
Important: Don’t use the “Microsoft Windows SDK for Windows 7 and .NET Framework 4″ because it’s not compatible with msvc++ express 2008 edition.
1.4 - Install the Python Setup Tools available here: http://pypi.python.org/pypi/setuptools#downloads
1.5 -
Include in your Advanced Variables Environment the binaries of Python. Right click at “My Computer” icon -> Properties -> Advanced Environment and edit your Path Variable including this two directories there:
Path = C:\Python27\Scripts;C:\Python27; + Path
1) C:\Python27\Scripts 2) C:\Python27
1.6 - Copy this file:
C:\Program Files (x86)\Microsoft Visual Studio 9.0\VC\bin\vcvars64.bat
To this follow folder and rename the file (vcvars64.bat to vcvarsamd64.bat):
C:\Program Files (x86)\Microsoft Visual Studio 9.0\VC\bin\amd64\vcvarsamd64.bat
1.7 - Edit the file msvc9compiler.py inside of directory C:\Python27\Lib\distutils\msvc9compiler.py
After the line 651 approximately, find this line: –
ld_args.append(‘/MANIFESTFILE:’ + temp_manifest)
Add the following line after the above line:
ld_args.append('/MANIFEST')
1.8 - Edit the file msvccompiler.py inside of directory C:\Python27\Lib\distutils\msvccompiler.py
At line 153 approximately, insert this line: return 9.0 , as following, in this piece of code:
def get_build_version(): """Return the version of MSVC that was used to build Python. For Python 2.3 and up, the version number is included in sys.version. For earlier versions, assume the compiler is MSVC 6. """ return 9.0 prefix = "MSC v." i = string.find(sys.version, prefix) if i == -1: return 6
1.9 - Certify that exists the follow environment variable in your system, if don’t exist create a new one:
Name: VS90COMNTOOLS Value: C:\Program Files (x86)\Microsoft Visual Studio 9.0\Common7\Tools\
1.10 - Extract the file pycrypto-2.3.tar.gz that you downloaded before, open a dos command and access the pycrypto-2.3 folder
1.11 - Execute this command to compile, build and install the module:
python setup.py build --compiler msvc python setup.py install
1.12 - Test if the package was generated successfully executing an import Crypto at Python shell.
1.13 - It’s finish. Optionally, you can distribute your compiled modules as an windows executable (.exe) file, executing this simple command on folder of your module, this case is pycrypto-2.3:
python setup.py bdist_wininst
As a result you will get a executable file with graphical interface created inside of folder “dist” and other people can install this executable file without to prepare a complex environment for build your own module. This is my result file of this process. http://arquivos.victorjabur.com/python/modules/pycrypto-2.3.win-amd64-py2.7.exe
2 – Building and Installing PyCrypto Module for Windows All Versions 32 bits:
2.1 - You must have installed the Python 32 bits version: http://www.python.org/ftp/python/2.7.1/python-2.7.1.msi
2.2 - You should install the C Compiler for Windows – Microsoft Visual C++ Express Edition 2008 : available here:http://www.microsoft.com/express/Downloads/#Visual_Studio_2008_Express_Downloads
ISO File to Download: http://www.microsoft.com/express/Downloads/#2008-All
2.3 - Install the Python Setup Tools available here: http://pypi.python.org/pypi/setuptools#downloads
2.4 -
Include in your Advanced Variables Environment the binaries of Python. Right click at “My Computer” icon -> Properties -> Advanced Environment and edit your Path Variable including this two directories there:
Path = C:\Python27\Scripts;C:\Python27; + Path
1) C:\Python27\Scripts 2) C:\Python27
2.5 - Edit the file msvc9compiler.py inside of directory C:\Python27\Lib\distutils\msvc9compiler.py
After the line 651 approximately, find this line: –
ld_args.append(‘/MANIFESTFILE:’ + temp_manifest)
Add the following line after the above line:
ld_args.append('/MANIFEST')
2.6 - Edit the file msvccompiler.py inside of directory C:\Python27\Lib\distutils\msvccompiler.py
At line 153 approximately, insert this line: return 9.0 , as following, in this piece of code:
def get_build_version(): """Return the version of MSVC that was used to build Python. For Python 2.3 and up, the version number is included in sys.version. For earlier versions, assume the compiler is MSVC 6. """ return 9.0 prefix = "MSC v." i = string.find(sys.version, prefix) if i == -1: return 6
2.7 - Certify that exists the follow environment variable in your system, if don’t exist create a new one:
Name: VS90COMNTOOLS Value: C:\Program Files (x86)\Microsoft Visual Studio 9.0\Common7\Tools\
2.8 - Extract the file pycrypto-2.3.tar.gz that you downloaded before, open a dos command and access the pycrypto-2.3 folder
2.9 - Execute this command to compile, build and install the module:
python setup.py build --compiler msvc python setup.py install
2.10 - Test if the package was generated successfully executing an import Crypto at Python shell.
2.11 - It’s finish. Optionally, you can distribute your compiled modules as an windows executable (.exe) file, executing this simple command on folder of your module, this case is pycrypto-2.3:
python setup.py bdist_wininst
As a result you will get a executable file with graphical interface created inside of folder “dist” and other people can install this executable file without to prepare a complex environment for build your own module. This is my result file of this process. http://arquivos.victorjabur.com/python/modules/pycrypto-2.3.win32-py2.7.exe
Credits and References to this post:
http://nukeit.org/compile-python-2-7-packages-with-visual-studio-2010-express/
http://yorickdowne.wordpress.com/2010/12/22/compiling-pycrypto-on-win7-64/
http://www.lfd.uci.edu/~gohlke/pythonlibs/
http://www.fuyun.org/2009/12/install-mysql-for-python-on-windows/
http://mattptr.net/2010/07/28/building-python-extensions-in-a-modern-windows-environment/
Good Bye.
Victor Jabur
发表评论
-
Django静态文件处理总结
2015-05-13 13:59 553原文地址:http://blog.csdn.net/wenxu ... -
原 异步非阻塞机制与多线程阻塞机制在处理并发耗时等待任务上的效率对比分析
2015-04-21 10:05 703原文地址:http://my.oschina.net/mall ... -
Django报错“_mysql_exceptions.Warning: Incorrect string value: ‘\xE6\xB5…’ for colu
2015-03-25 15:50 1004原文地址:http://www.tuicool.com/art ... -
django使用mysql时的中文存储问题 - [python]
2015-03-25 15:36 1514原文地址:http://www.blogbus.com/831 ... -
NIO学习笔记——解决“服务器端cpu占用率高”
2015-01-29 10:17 996原文地址:http://blog.csdn ... -
python 调用 php 实例
2014-06-23 14:09 2633原文地址:http://hi.baidu.com/ji_hai ... -
php调用python
2014-06-23 14:08 803原文地址:http://blog.163.com/darwin ... -
uwsgi python ssl编译问题记录
2014-06-19 14:24 885uwsgi python ssl编译问题记录 发表于6个月前( ... -
python2.7 安装ssl模块
2014-06-19 14:22 3233python2.7 安装ssl模块 2012-02-28 13 ... -
Centos6.5下升级Python 2.6.6 to python 2.7.3
2014-06-19 13:53 665Centos6.5下升级Python 2.6.6 to pyt ... -
翻译:redis-py 说明文件 (2012-05-30 17:55:52)
2014-06-04 10:22 467翻译:redis-py 说明文件 (2012-05-30 17 ... -
关于Redis的Python客户端的连接池问题
2014-06-04 10:21 631关于Redis的Python客户端的连接池问题 在一 ... -
Windows下 Python 安装包的配置
2014-03-22 10:23 6671、下载安装 Python python-2.7.2.msi ... -
[翻译]深入理解Tornado——一个异步web服务器
2014-03-07 15:16 1652[翻译]深入理解Tornado— ... -
多版本Python共存[支持使用pip安装包]
2014-02-28 10:59 1157多版本Python共存[支持使 ... -
Django 数据库访问性能优化
2013-09-05 15:22 690Django 数据库访问性 ... -
Python六大开源框架对比:Web2py略胜一筹
2013-08-21 11:29 837Python是一门动态、面向对象语言。其最初就是作为一门面向 ... -
Python 代码调试技巧
2013-08-15 18:11 880使用 pdb 进行调试 pdb 是 python 自带的 ... -
python urlencode 编码
2013-07-05 13:28 972urlencode 调用方法 urlencode的参 ... -
window下使用virtualenv
2013-06-30 15:26 1127--- window下使用virtualenv -- ...
相关推荐
另外,"Eclipse Python插件安装.doc"文档很可能是提供更详细的PyDev安装步骤和使用指南。用户应仔细阅读该文档,以确保正确安装并充分利用PyDev的所有功能。 在使用PyDev进行Python开发时,你可以创建新的Python...
python安装工具及安装步骤python安装工具及安装步骤python安装工具及安装步骤 python安装工具及安装步骤 python安装工具及安装步骤 python安装工具及安装步骤python安装工具及安装步骤python安装工具及安装步骤...
#### 三、PythonOCC的安装方法 PythonOCC的安装有多种途径,其中最简便的方式之一是通过Anaconda环境进行安装。下面是详细的安装步骤: #### 四、安装Anaconda Anaconda是一款非常方便的科学计算软件包管理系统及...
安装PythonScript插件的过程相当简单。首先,你需要下载与Notepad++版本兼容的PythonScript插件包,例如提供的"PythonScript_1.0.8.0.msi"文件。这通常是一个安装程序,可以双击运行。按照安装向导的指示进行操作,...
Python 3.11.4(64-bit)软件安装指南 Python 是一种广泛使用的高级编程语言,具有简洁的语法和强大的功能。安装 Python 软件是使用 Python 语言进行开发的第一步骤。下面是 Python 3.11.4(64-bit)软件安装指南。 ...
Eclipse安装python插件
Python和SCons是两个在软件开发领域常用的工具。Python是一种高级编程语言,以其简洁明了的语法和强大的功能而受到广泛欢迎。SCons则是一个构建工具,它使用Python编写,用于自动化软件构建过程,替代传统的Make工具...
本资源是Python2.7.10版本的安装软件,以及安装过程中遇到问题的所有讲解
到此这篇关于Pycharm安装python库的方法的文章就介绍到这了,更多相关Pycharm安装python库内容请搜索软件开发网以前的文章或继续浏览下面的相关文章希望大家以后多多支持软件开发网! 您可能感兴趣的文章:Pycharm中...
该软件安装包内含有一系列综合性功能,旨在为考生提供一个与正式考试尽可能相似的界面和操作体验。通过本软件,用户可以熟悉官方的考试流程、题型和界面布局,以减少在实际考试中因不熟悉环境带来的不必要的紧张情绪...
该资源主要是Python的PIP安装软件,主要包括四个文件: python-2.7.8.amd64.msi,这个你可以在官网下载适合自己的版本。 另一个是pip-Win_1.7.exe软件,但强烈推荐大家安装完Python环境后,双击get-pip.py软件即可...
本文将详细介绍如何在Eclipse中安装Python插件,以便在Eclipse中愉快地编写Python代码。 首先,你需要了解Eclipse的扩展性是通过插件机制实现的。Eclipse拥有一个庞大的插件市场,其中包含了许多针对不同编程语言的...
下面将详细介绍如何安装Python插件以及如何将Sublime Text添加到Windows系统的右键菜单,以便快速打开文件。 首先,安装Python插件通常通过Sublime Text的包管理器——Package Control来完成。Package Control是...
---python64 位安装32位python 原来安装的是64位,打包出来的程序也是64,到WIN7 32 上运行不了,需要安装32位python. 安装步骤如下: 1:安装32位python python-3.7.2_x86.exe 安装路径如下,添加到系统path C:\...
写在前面:该插件可以直接在notepad++插件管理器中安装,如果安装完之后,运行出现: Unknown exception和python script plugin did not accept the script的报错提示,一般在window7/8/10 64位系统报错。...
AIX的软件更新可以通过`installp -u`命令进行,但Python的更新可能需要重复上述安装步骤。 7. 开发和运行Python应用: 现在你已经在AIX 7.1上安装了Python,可以开始编写和运行Python代码了。你可以使用`python`或...
比如你的python安装目录是C:\python27-x64 添加环境变量 PYTHONHOME=C:\python27-x64 QT_QPA_PLATFORM_PLUGIN_PATH=C:\python27-x64\Lib\site-packages\PyQt5\plugins\platforms 修改IDA 7.0目录\plugins\plugins....
在本文中,我们将详细介绍如何在Eclipse中安装Python插件PyDev,以便于在Eclipse环境中进行Python开发。Eclipse是一款强大的集成开发环境(IDE),通过安装PyDev插件,我们可以获得针对Python语言的专门支持,包括...
验证安装是否成功的方法是在命令行输入 `python` 进入 Python 解释器,再输入 `import zope.interface`,若没有错误提示,则表示安装成功。 - **安装 pyOpenSSL** 访问 https://pypi.python.org/pypi/pyOpenSSL/ ...
本教程将详细讲解如何在STM32-F0/F1/F2系列微控制器上安装和使用Python插件,以提升开发效率和功能实现。 首先,我们要明确Python在嵌入式环境中的应用通常指的是MicroPython或CircuitPython等轻量级版本,它们是...