嗯,我想安裝PyMSSQL-2.0.0b1,並不能實現這一點,得到奇怪的錯誤...我試過一些解決方案,發現谷歌和StackOverflow,但仍然無法編譯...錯誤:安裝PyMSSQL-2.0.0b1時無法找到vcvarsall.bat ...我錯過了什麼?
請什麼我錯過了?
( ,所以我曾嘗試:
- 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的」部分(順便說一句,如果我的理解是確定)
實際上同時卸載,然後重新安裝只有32位版本。看起來安裝時還有其他一些困難。因此,決定堅持使用32位版本,僅針對Python和其他庫,以避免任何不兼容,出於同樣的原因,堅持使用Python 2.7。 – lctv31