2014-07-02 156 views
0

在安装第三方软件包时,我一直在使用Pycharm时遇到“无法找到vcvarsall.bat”错误easy_install的。错误:命令'c:\ mingw \ bin \ gcc.exe'失败,退出状态为1

一旦安装MinGW的,经检查发现gcc编译器标记,配置distutils.cfg,并改变了PATH变量,我发现以下问题:

Install packages failed: Error occurred when installing package pysqlite. 

The following command was executed: 

packaging_tool.py install --build-dir C:\Users\Francisco\AppData\Local\Temp\pycharm- packaging5564903716757323670.tmp pysqlite 

The error output of the command: 


Downloading/unpacking pysqlite 
Running setup.py egg_info for package pysqlite 

Installing collected packages: pysqlite 
    Running setup.py install for pysqlite 
    building 'pysqlite2._sqlite' extension 
    c:\mingw\bin\gcc.exe -mdll -O -Wall -DMODULE_NAME=\"pysqlite2.dbapi2\" - DSQLITE_OMIT_LOAD_EXTENSION=1 -IC:\Python27\include -IC:\Python27\PC -c src/module.c -o build\temp.win32-2.7\Release\src\module.o 
In file included from src/module.c:24: 
src/connection.h:33:21: error: sqlite3.h: No such file or directory 
In file included from src/module.c:24: 
src/connection.h:38: error: expected specifier-qualifier-list before 'sqlite3' 
In file included from src/module.c:25: 
src/statement.h:37: error: expected specifier-qualifier-list before 'sqlite3' 
src/module.c: In function 'module_complete': 
src/module.c:103: warning: implicit declaration of function 'sqlite3_complete' 
src/module.c: At top level: 
src/module.c:269: error: 'SQLITE_OK' undeclared here (not in a function) 
src/module.c:270: error: 'SQLITE_DENY' undeclared here (not in a function) 
src/module.c:271: error: 'SQLITE_IGNORE' undeclared here (not in a function) 
src/module.c:272: error: 'SQLITE_CREATE_INDEX' undeclared here (not in a function) 
src/module.c:273: error: 'SQLITE_CREATE_TABLE' undeclared here (not in a function) 
src/module.c:274: error: 'SQLITE_CREATE_TEMP_INDEX' undeclared here (not in a function) 
src/module.c:275: error: 'SQLITE_CREATE_TEMP_TABLE' undeclared here (not in a function) 
src/module.c:276: error: 'SQLITE_CREATE_TEMP_TRIGGER' undeclared here (not in a function) 
src/module.c:277: error: 'SQLITE_CREATE_TEMP_VIEW' undeclared here (not in a function) 
src/module.c:278: error: 'SQLITE_CREATE_TRIGGER' undeclared here (not in a function) 
src/module.c:279: error: 'SQLITE_CREATE_VIEW' undeclared here (not in a function) 
src/module.c:280: error: 'SQLITE_DELETE' undeclared here (not in a function) 
src/module.c:281: error: 'SQLITE_DROP_INDEX' undeclared here (not in a function) 
src/module.c:282: error: 'SQLITE_DROP_TABLE' undeclared here (not in a function) 
src/module.c:283: error: 'SQLITE_DROP_TEMP_INDEX' undeclared here (not in a function) 
src/module.c:284: error: 'SQLITE_DROP_TEMP_TABLE' undeclared here (not in a function) 
src/module.c:285: error: 'SQLITE_DROP_TEMP_TRIGGER' undeclared here (not in a function) 
src/module.c:286: error: 'SQLITE_DROP_TEMP_VIEW' undeclared here (not in a function) 
src/module.c:287: error: 'SQLITE_DROP_TRIGGER' undeclared here (not in a function) 
src/module.c:288: error: 'SQLITE_DROP_VIEW' undeclared here (not in a function) 
src/module.c:289: error: 'SQLITE_INSERT' undeclared here (not in a function) 
src/module.c:290: error: 'SQLITE_PRAGMA' undeclared here (not in a function) 
src/module.c:291: error: 'SQLITE_READ' undeclared here (not in a function) 
src/module.c:292: error: 'SQLITE_SELECT' undeclared here (not in a function) 
src/module.c:293: error: 'SQLITE_TRANSACTION' undeclared here (not in a function) 
src/module.c:294: error: 'SQLITE_UPDATE' undeclared here (not in a function) 
src/module.c:295: error: 'SQLITE_ATTACH' undeclared here (not in a function) 
src/module.c:296: error: 'SQLITE_DETACH' undeclared here (not in a function) 
src/module.c: In function 'init_sqlite': 
src/module.c:426: warning: implicit declaration of function 'sqlite3_libversion' 
src/module.c:426: warning: passing argument 1 of 'PyString_FromString' makes pointer from integer without a cast 
error: command 'c:\\mingw\\bin\\gcc.exe' failed with exit status 1 
Complete output from command C:\Python27\python.exe -c "import setuptools;__file__='C:\\Users\\Francisco\\AppData\\Local\\Temp\\pycharm- packaging5564903716757323670.tmp\\pysqlite\\setup.py';exec(compile(open(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record c:\users\franci~1\appdata\local\temp\pip-obw3c6-record\install-record.txt --single-version-externally-managed: 
running install 

running build 

running build_py 

creating build 

creating build\lib.win32-2.7 

creating build\lib.win32-2.7\pysqlite2 

copying lib\dbapi2.py -> build\lib.win32-2.7\pysqlite2 

copying lib\dump.py -> build\lib.win32-2.7\pysqlite2 

copying lib\__init__.py -> build\lib.win32-2.7\pysqlite2 

creating build\lib.win32-2.7\pysqlite2\test 

copying lib\test\dbapi.py -> build\lib.win32-2.7\pysqlite2\test 

copying lib\test\dump.py -> build\lib.win32-2.7\pysqlite2\test 

copying lib\test\factory.py -> build\lib.win32-2.7\pysqlite2\test 

copying lib\test\hooks.py -> build\lib.win32-2.7\pysqlite2\test 

copying lib\test\regression.py -> build\lib.win32-2.7\pysqlite2\test 

copying lib\test\transactions.py -> build\lib.win32-2.7\pysqlite2\test 

copying lib\test\types.py -> build\lib.win32-2.7\pysqlite2\test 

copying lib\test\userfunctions.py -> build\lib.win32-2.7\pysqlite2\test 

copying lib\test\__init__.py -> build\lib.win32-2.7\pysqlite2\test 

creating build\lib.win32-2.7\pysqlite2\test\py25 

copying lib\test\py25\py25tests.py -> build\lib.win32-2.7\pysqlite2\test\py25 

copying lib\test\py25\__init__.py -> build\lib.win32-2.7\pysqlite2\test\py25 

running build_ext 

building 'pysqlite2._sqlite' extension 

creating build\temp.win32-2.7 

creating build\temp.win32-2.7\Release 

creating build\temp.win32-2.7\Release\src 

c:\mingw\bin\gcc.exe -mdll -O -Wall -DMODULE_NAME=\"pysqlite2.dbapi2\" -DSQLITE_OMIT_LOAD_EXTENSION=1 -IC:\Python27\include -IC:\Python27\PC -c src/module.c -o build\temp.win32-2.7\Release\src\module.o 

In file included from src/module.c:24: 

src/connection.h:33:21: error: sqlite3.h: No such file or directory 

In file included from src/module.c:24: 

src/connection.h:38: error: expected specifier-qualifier-list before 'sqlite3' 

In file included from src/module.c:25: 

src/statement.h:37: error: expected specifier-qualifier-list before 'sqlite3' 

src/module.c: In function 'module_complete': 

src/module.c:103: warning: implicit declaration of function 'sqlite3_complete' 

src/module.c: At top level: 

src/module.c:269: error: 'SQLITE_OK' undeclared here (not in a function) 

src/module.c:270: error: 'SQLITE_DENY' undeclared here (not in a function) 

src/module.c:271: error: 'SQLITE_IGNORE' undeclared here (not in a function) 

src/module.c:272: error: 'SQLITE_CREATE_INDEX' undeclared here (not in a function) 

src/module.c:273: error: 'SQLITE_CREATE_TABLE' undeclared here (not in a function) 

src/module.c:274: error: 'SQLITE_CREATE_TEMP_INDEX' undeclared here (not in a function) 

src/module.c:275: error: 'SQLITE_CREATE_TEMP_TABLE' undeclared here (not in a function) 

src/module.c:276: error: 'SQLITE_CREATE_TEMP_TRIGGER' undeclared here (not in a function) 

src/module.c:277: error: 'SQLITE_CREATE_TEMP_VIEW' undeclared here (not in a function) 

src/module.c:278: error: 'SQLITE_CREATE_TRIGGER' undeclared here (not in a function) 

src/module.c:279: error: 'SQLITE_CREATE_VIEW' undeclared here (not in a function) 

src/module.c:280: error: 'SQLITE_DELETE' undeclared here (not in a function) 

src/module.c:281: error: 'SQLITE_DROP_INDEX' undeclared here (not in a function) 

src/module.c:282: error: 'SQLITE_DROP_TABLE' undeclared here (not in a function) 

src/module.c:283: error: 'SQLITE_DROP_TEMP_INDEX' undeclared here (not in a function) 

src/module.c:284: error: 'SQLITE_DROP_TEMP_TABLE' undeclared here (not in a function) 

src/module.c:285: error: 'SQLITE_DROP_TEMP_TRIGGER' undeclared here (not in a function) 

src/module.c:286: error: 'SQLITE_DROP_TEMP_VIEW' undeclared here (not in a function) 

src/module.c:287: error: 'SQLITE_DROP_TRIGGER' undeclared here (not in a function) 

src/module.c:288: error: 'SQLITE_DROP_VIEW' undeclared here (not in a function) 

src/module.c:289: error: 'SQLITE_INSERT' undeclared here (not in a function) 

src/module.c:290: error: 'SQLITE_PRAGMA' undeclared here (not in a function) 

src/module.c:291: error: 'SQLITE_READ' undeclared here (not in a function) 

src/module.c:292: error: 'SQLITE_SELECT' undeclared here (not in a function) 

src/module.c:293: error: 'SQLITE_TRANSACTION' undeclared here (not in a function) 

src/module.c:294: error: 'SQLITE_UPDATE' undeclared here (not in a function) 

src/module.c:295: error: 'SQLITE_ATTACH' undeclared here (not in a function) 

src/module.c:296: error: 'SQLITE_DETACH' undeclared here (not in a function) 

src/module.c: In function 'init_sqlite': 

src/module.c:426: warning: implicit declaration of function 'sqlite3_libversion' 

src/module.c:426: warning: passing argument 1 of 'PyString_FromString' makes pointer  from integer without a cast 

error: command 'c:\\mingw\\bin\\gcc.exe' failed with exit status 1 

我工作过Windows 8的可能问题出在python的* .h文件中。任何想法?

+0

你为什么要安装'pysqlite'? SQLite兼容性包含在Python中。 –

回答

1

的主要错误是这样一个

src/connection.h:33:21: error: sqlite3.h: No such file or directory 

你没有sqlite3的头文件,因此它可以编译扩展。 MinGW编译器似乎工作正常。

您需要下载the source code,构建它并将其提供给easy_install,并且与其他依赖关系相同。

但是,我想知道为什么你需要安装pysqlite,当你已经有sqlite3模块作为标准windows Python发行版的一部分。只需输入口译员并发出import sqlite3命令。

+0

谢谢您的及时答复。我不知道该怎么做,但我会以某种方式解决它。回答你的问题:我需要升级sqlite3版本,因为它无法打开某些特定的数据库。它只是说,sqlite文件已损坏或加密。此外,我试图通过PyCharm Package安装界面来安装它,但它总是会出现上述错误。 – user3798103

+0

如果数据库已加密,请确保您正在构建的这个PySqlite模块支持加密扩展。我相信(但可能是错误的),PySqlite只是一个相同的sqlite3内置模块,如果需要的话,它会被编译为每一个python版本。另外,如果您对响应满意,则可以使用StackOverflow方式接受它。 – deStrangis

+0

因为我可以从sqlite3命令行打开它,所以完全不是加密问题。干杯。 – user3798103

相关问题