2017-05-26 192 views
0

我在windows10上使用python27,pip。我正在嘗試安裝pyzipcode模塊。 但我面對這個錯誤。安裝python模塊時出錯-pyzipcode,sqlite3

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 

回答

1

當您安裝pyzipcode,它需要pysqlite。 Pysqlite由源代碼構建(因此涉及到mingw),但它至少需要開發頭文件。

但是,Python 2.7有一個內置的sqlite庫,所以這可能不是必需的。嘗試使用「不安裝依賴關係」選項來使用pip。

pip install --no-deps pyzipcode

+0

謝謝你的工作 –

1

可能是你的gcc或者gcc +包有一些問題。請先安裝它,然後再次嘗試安裝pyzipcode。

「PIP安裝熊貓」可以幫助您在安裝或更新的gcc