我在Windows10上使用python27pip。我正在尝试安装pyzipcode模块。
但是我正面临着这个错误。

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_connect':
     src/module.c:63: error: 'SQLITE_OPEN_READWRITE' undeclared (first use in this function)
     src/module.c:63: error: (Each undeclared identifier is reported only once
     src/module.c:63: error: for each function it appears in.)
     src/module.c:63: error: 'SQLITE_OPEN_CREATE' undeclared (first use in this function)
     src/module.c: In function 'module_complete':
     src/module.c:102: warning: implicit declaration of function 'sqlite3_complete'
     src/module.c: In function 'init_sqlite':
     src/module.c:401: warning: implicit declaration of function 'sqlite3_libversion'
     src/module.c:401: 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

最佳答案

当您安装pyzipcode时,它需要pysqlite。
Pysqlite是从源代码构建的(因此需要mingw参与),但是它(至少)需要它的开发头文件。

但是,Python 2.7为sqlite内置了一个库,因此可能不需要。尝试将pip与“不安装依赖项”选项一起使用。

pip install --no-deps pyzipcode

08-28 18:49