安装python模块时出错 - pyzipcode,sqlite3

时间:2017-05-26 06:11:03

标签: python sqlite pip

我在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

2 个答案:

答案 0 :(得分:1)

可能是你的gcc或gcc +包有一些问题。请先安装它,然后再尝试安装pyzipcode。

“pip install pandas”可能会帮助您安装或更新gcc

答案 1 :(得分:1)

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

但是,Python 2.7有一个用于sqlite的内置库,因此可能不需要这样做。尝试使用带有“不安装依赖项”选项的pip。

pip install --no-deps pyzipcode