ICode9

精准搜索请尝试: 精确搜索
首页 > 数据库> 文章详细

python-错误:安装PyMSSQL-2.0.0b1时找不到vcvarsall.bat…我缺少什么?

2019-12-02 05:55:07  阅读:383  来源: 互联网

标签:installation pymssql python sql-server


好吧,我尝试安装PyMSSQL-2.0.0b1并无法实现这一点,得到奇怪的错误…我尝试了一些在Google和StackOverflow上找到的解决方案,但仍然无法编译…

请我想念什么?

(
所以我尝试了:

- to add --compiler=mingw32 after setup.py install build 
- to create a distutils.cfd file in Python27\lib\distutils\distutils.cfg with 
    [build]
    compiler=mingw32

仍然无法正常工作
)

(也是我在Windows 7上,并且我需要第三方库,必须坚持使用32位版本和2.7)

这是一些错误日志:

C:\Users\MyUserName\Desktop\downloaded\python\pymssql-2.0.0b1-dev-20111019>setup.py install build
running install
running bdist_egg
running egg_info
writing pymssql.egg-info\PKG-INFO
writing top-level names to pymssql.egg-info\top_level.txt
writing dependency_links to pymssql.egg-info\dependency_links.txt
reading manifest file 'pymssql.egg-info\SOURCES.txt'
reading manifest template 'MANIFEST.in'
writing manifest file 'pymssql.egg-info\SOURCES.txt'
installing library code to build\bdist.win32\egg
running install_lib
running build_ext
skipping '_mssql.c' Cython extension (up-to-date)
building '_mssql' extension
error: Unable to find vcvarsall.bat

C:\Users\MyUserName\Desktop\downloaded\python\pymssql-2.0.0b1-dev-20111019>setup.
py install build --compiler=mingw32
running install
running bdist_egg
running egg_info
writing pymssql.egg-info\PKG-INFO
writing top-level names to pymssql.egg-info\top_level.txt
writing dependency_links to pymssql.egg-info\dependency_links.txt
reading manifest file 'pymssql.egg-info\SOURCES.txt'
reading manifest template 'MANIFEST.in'
writing manifest file 'pymssql.egg-info\SOURCES.txt'
installing library code to build\bdist.win32\egg
running install_lib
running build_ext
skipping '_mssql.c' Cython extension (up-to-date)
building '_mssql' extension
c:\MinGW\bin\gcc.exe -mno-cygwin -mdll -O -Wall -IC:\Users\MyUserName\Desktop\laur
ent.CTV\python\pymssql-2.0.0b1-dev-20111019\win32\freetds\include -IC:\Python27\
include -IC:\Python27\PC -c _mssql.c -o build\temp.win32-2.7\Release\_mssql.o -D
MSDBLIB -Wl,-allow-multiple-definition -Wl,-subsystem,windows-mthreads -mwindows
 -Wl,--strip-all
cc1.exe: erreur: unrecognized command line option '-mno-cygwin'
error: command 'gcc' failed with exit status 1

C:\Users\MyUserName\Desktop\downloaded\python\pymssql-2.0.0b1-dev-20111019>python

Python 2.7.2 (default, Jun 12 2011, 15:08:59) [MSC v.1500 32 bit (Intel)] on win
32
Type "help", "copyright", "credits" or "license" for more information.
>>> ^Z

C:\Users\MyUserName\Desktop\downloaded\python\pymssql-2.0.0b1-dev-20111019>gcc --version
gcc (GCC) 4.6.1
Copyright © 2011 Free Software Foundation, Inc.
Ce logiciel est libre; voir les sources pour les conditions de copie.  Il n'y a
PAS
GARANTIE; ni implicite pour le MARCHANDAGE ou pour un BUT PARTICULIER.

创建disutils.cfg之后

C:\Users\MyUserName\Desktop\downloaded\python\pymssql-2.0.0b1-dev-20111019>setup.py install build
running install
running bdist_egg
running egg_info
writing pymssql.egg-info\PKG-INFO
writing top-level names to pymssql.egg-info\top_level.txt
writing dependency_links to pymssql.egg-info\dependency_links.txt
reading manifest file 'pymssql.egg-info\SOURCES.txt'
reading manifest template 'MANIFEST.in'
writing manifest file 'pymssql.egg-info\SOURCES.txt'
installing library code to build\bdist.win32\egg
running install_lib
running build_ext
skipping '_mssql.c' Cython extension (up-to-date)
building '_mssql' extension
c:\MinGW\bin\gcc.exe -mno-cygwin -mdll -O -Wall -IC:\Users\MyUserName\Desktop\laur
ent.CTV\python\pymssql-2.0.0b1-dev-20111019\win32\freetds\include -IC:\Python27\
include -IC:\Python27\PC -c _mssql.c -o build\temp.win32-2.7\Release\_mssql.o -D
MSDBLIB -Wl,-allow-multiple-definition -Wl,-subsystem,windows-mthreads -mwindows
 -Wl,--strip-all
cc1.exe: erreur: unrecognized command line option '-mno-cygwin'
error: command 'gcc' failed with exit status 1

C:\Users\MyUserName\Desktop\downloaded\python\pymssql-2.0.0b1-dev-20111019>type c:\Python27\lib\distutils\distutils.cfg
[build]
compiler=mingw32

编辑:似乎是一个与http://bugs.python.org/issue12641和’-mno-cygwin’部分有关的未解决问题(顺便说一句,如果我的理解还可以)

解决方法:

为python 2.7安装软件包时,它会搜索Visual Studio2008.要解决此问题,我要做的就是在调用setup.py之前设置VS90COMNTOOLS变量.

如果安装了Visual Studio 2010,请执行

SET VS90COMNTOOLS=%VS100COMNTOOLS%

或安装了Visual Studio 2012

SET VS90COMNTOOLS=%VS110COMNTOOLS%

标签:installation,pymssql,python,sql-server
来源: https://codeday.me/bug/20191202/2086400.html

本站声明: 1. iCode9 技术分享网(下文简称本站)提供的所有内容,仅供技术学习、探讨和分享;
2. 关于本站的所有留言、评论、转载及引用,纯属内容发起人的个人观点,与本站观点和立场无关;
3. 关于本站的所有言论和文字,纯属内容发起人的个人观点,与本站观点和立场无关;
4. 本站文章均是网友提供,不完全保证技术分享内容的完整性、准确性、时效性、风险性和版权归属;如您发现该文章侵犯了您的权益,可联系我们第一时间进行删除;
5. 本站为非盈利性的个人网站,所有内容不会用来进行牟利,也不会利用任何形式的广告来间接获益,纯粹是为了广大技术爱好者提供技术内容和技术思想的分享性交流网站。

专注分享技术,共同学习,共同进步。侵权联系[81616952@qq.com]

Copyright (C)ICode9.com, All Rights Reserved.

ICode9版权所有