错误:安装PyMSSQL-2.0.0b1时找不到vcvarsall.bat ...我缺少什么? [英] error: Unable to find vcvarsall.bat when installing PyMSSQL-2.0.0b1... what am i missing?

查看:83
本文介绍了错误:安装PyMSSQL-2.0.0b1时找不到vcvarsall.bat ...我缺少什么?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

好吧,我正在尝试安装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变量. /p>

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

SET VS90COMNTOOLS =%VS100COMNTOOLS%

或安装了Visual Studio 2012

SET VS90COMNTOOLS =%VS110COMNTOOLS%

Well i am trying to install PyMSSQL-2.0.0b1 and can not achieve this, get strange errors... i have tried some solutions found on Google and StackOverflow but still unable to compile...

please what am i missing ?

( so i have tried :

- 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

and still not working )

(also i'm on Windows 7, and i has need third party libs, must stick to 32 bits version and 2.7)

here are some log with errors :

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.

after creating 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

EDIT : looks like an open issue as related to http://bugs.python.org/issue12641 and the '-mno-cygwin' part (btw if my understanding is ok)

解决方案

When you install packages for python 2.7 it searches for Visual Studio 2008. All I had to do to fix this is set the VS90COMNTOOLS variable before calling setup.py

If you have Visual Studio 2010 installed, execute

SET VS90COMNTOOLS=%VS100COMNTOOLS%

or with Visual Studio 2012 installed

SET VS90COMNTOOLS=%VS110COMNTOOLS%

这篇关于错误:安装PyMSSQL-2.0.0b1时找不到vcvarsall.bat ...我缺少什么?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆