一篇转帖,为以后碰到error: Python was built with Visual Studio 2003; 这种恶心问题找个棒槌
来源:互联网 发布:wireshark过滤ip和端口 编辑:程序博客网 时间:2024/06/11 18:36
( 转帖)如果你有陈旧的vs2003编译器,那么这篇短文或者意义不是很大,
http://blog.donews.com/tekjian/archive/2006/08/06/990279.aspx 有简单的介绍如何直接安装这个玩意儿。
但是,现在很多人都用上了vs2005或者vs2008,可是python还是用的2.5.x版。这个时候痛苦就来了,
下载完python-sybase-0.38之后,如果你执行:
python setup.py intall,
肯定会出这样的错:
引用
error: Python was built with Visual Studio 2003;
extensions must be built with a compiler than can generate compatible binaries.
Visual Studio 2003 was not found on this system. If you have Cygwin installed,
you can try compiling with MingW32, by passing "-c mingw32" to setup.py.
经过若干周折,发现,有办法绕过去,让vs2008直接支持编译安装。
先让sybase.bat环境变量生效,接着让vcvars.bat生效,(即执行这两个 bat)
把ASE15.x\OCS-150\lib下的三个文件libsyb*.lib,重命名为lib*.lib, 这三个新文件是:libct.lib, libcs.lib, libblk.lib
然后要修改python\Lib\distutils\msvccomiler.py, 找到:
Java代码
# x86
if self.__version >= 7:
self.__root = r"Software\Microsoft\VisualStudio"
self.__macros = MacroExpander(self.__version)
else:
self.__root = r"Software\Microsoft\Devstudio"
# x86
if self.__version >= 7:
self.__root = r"Software\Microsoft\VisualStudio"
self.__macros = MacroExpander(self.__version)
else:
self.__root = r"Software\Microsoft\Devstudio"
注释掉这一行:self.__macros = MacroExpander(self.__version)
之后,把对应的pyc文件删掉,让它强制重新编译。
设置两个环境变量:set DISTUTILS_USE_SDK=1
set MSSdk=1
这之后执行python setup.py install, 就可以完全成功的安装了。
http://blog.donews.com/tekjian/archive/2006/08/06/990279.aspx 有简单的介绍如何直接安装这个玩意儿。
但是,现在很多人都用上了vs2005或者vs2008,可是python还是用的2.5.x版。这个时候痛苦就来了,
下载完python-sybase-0.38之后,如果你执行:
python setup.py intall,
肯定会出这样的错:
引用
error: Python was built with Visual Studio 2003;
extensions must be built with a compiler than can generate compatible binaries.
Visual Studio 2003 was not found on this system. If you have Cygwin installed,
you can try compiling with MingW32, by passing "-c mingw32" to setup.py.
经过若干周折,发现,有办法绕过去,让vs2008直接支持编译安装。
先让sybase.bat环境变量生效,接着让vcvars.bat生效,(即执行这两个 bat)
把ASE15.x\OCS-150\lib下的三个文件libsyb*.lib,重命名为lib*.lib, 这三个新文件是:libct.lib, libcs.lib, libblk.lib
然后要修改python\Lib\distutils\msvccomiler.py, 找到:
Java代码
# x86
if self.__version >= 7:
self.__root = r"Software\Microsoft\VisualStudio"
self.__macros = MacroExpander(self.__version)
else:
self.__root = r"Software\Microsoft\Devstudio"
# x86
if self.__version >= 7:
self.__root = r"Software\Microsoft\VisualStudio"
self.__macros = MacroExpander(self.__version)
else:
self.__root = r"Software\Microsoft\Devstudio"
注释掉这一行:self.__macros = MacroExpander(self.__version)
之后,把对应的pyc文件删掉,让它强制重新编译。
设置两个环境变量:set DISTUTILS_USE_SDK=1
set MSSdk=1
这之后执行python setup.py install, 就可以完全成功的安装了。
- 一篇转帖,为以后碰到error: Python was built with Visual Studio 2003; 这种恶心问题找个棒槌
- error: Python was built with Visual Studio 2003
- error: Python was built with Visual Studio 2003
- 今天碰到个错误,ile was built for unsupported file format which is not the architecture being linked (armv7)
- binary was not built with debug information
- binary was not built with debug information
- binary was not built with debug information
- ----谁会碰到这么恶心的问题。。。
- 使用visual studio 2012碰到的“Stack OverFlow ”的问题
- Visual Studio 2012以后无法保存只读文件的问题
- 【恶心的模拟 && 找时刻问题】CodeForces
- iOS error APPLE LLVM 5.1 Error UIKit.pcm was built
- Visual Studio: MSB3073 error exited with code 1
- android studio 碰到问题
- Android积累 the project was not built due to "a resource exists with a different case问题
- android出现the project was not built due to "a resource exists with a different case问题
- android出现the project was not built due to "a resource exists with a different case问题
- 【安卓学习问题日志】The project was not built due to "A resource exists with a different case
- 文摘:在企业应用系统及开发中运用黑盒/白盒模型概念
- 基于TCP 的网络编程步骤
- 排序算法,数组进阶及面向对象基础
- C语言编程译密码
- Hive索引使用
- 一篇转帖,为以后碰到error: Python was built with Visual Studio 2003; 这种恶心问题找个棒槌
- Yii 验证码(captcha)的使用
- iphone ios json解析流程,教程
- phpBatis组件
- jiexi
- android--widget介绍之AutoCompleteTextView
- 面向对象进一步内容
- MFC如何封装WINDOWS应用程序的流程
- 字符串转化为数值