2017-03-01 192 views
0

我想我的電腦上安裝python pyminizip模塊,但我有休耕錯誤:錯誤安裝時蟒蛇pyminizip模塊和ZLIB.DLL

C:\Python27\Scripts>pip install pyminizip 
Collecting pyminizip 
    Using cached pyminizip-0.2.1.tar.gz 
Installing collected packages: pyminizip 
    Running setup.py install for pyminizip ... error 
    Complete output from command c:\python27\python.exe -u -c "import setuptools 
, tokenize;__file__='c:\\users\\andrei~1.gug\\appdata\\local\\temp\\pip-build-mb 
aaft\\pyminizip\\setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.re 
ad().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" inst 
all --record c:\users\andrei~1.gug\appdata\local\temp\pip-9hqnfh-record\install- 
record.txt --single-version-externally-managed --compile: 
    running install 
    running build 
    running build_ext 
    building 'pyminizip' extension 
    creating build 
    creating build\temp.win32-2.7 
    creating build\temp.win32-2.7\Release 
    creating build\temp.win32-2.7\Release\src 
    C:\Users\Andrei-Cristian.GUGI\AppData\Local\Programs\Common\Microsoft\Visual 
C++ for Python\9.0\VC\Bin\cl.exe /c /nologo /Ox /MD /W3 /GS- /DNDEBUG -Isrc -Ic 
:\python27\include -Ic:\python27\PC /Tcsrc/py_minizip.c /Fobuild\temp.win32-2.7\ 
Release\src/py_minizip.obj 
    py_minizip.c 
    c:\users\andrei-cristian.gugi\appdata\local\temp\pip-build-mbaaft\pyminizip\ 
src\zip.h(43) : fatal error C1083: Cannot open include file: 'zlib.h': No such f 
ile or directory 
    error: command 'C:\\Users\\Andrei-Cristian.GUGI\\AppData\\Local\\Programs\\C 
ommon\\Microsoft\\Visual C++ for Python\\9.0\\VC\\Bin\\cl.exe' failed with exit 
status 2 

    ---------------------------------------- 
Command "c:\python27\python.exe -u -c "import setuptools, tokenize;__file__='c:\ 
\users\\andrei~1.gug\\appdata\\local\\temp\\pip-build-mbaaft\\pyminizip\\setup.p 
y';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n 
');f.close();exec(compile(code, __file__, 'exec'))" install --record c:\users\an 
drei~1.gug\appdata\local\temp\pip-9hqnfh-record\install-record.txt --single-vers 
ion-externally-managed --compile" failed with error code 1 in c:\users\andrei~1. 
gug\appdata\local\temp\pip-build-mbaaft\pyminizip\ 

我也嘗試安裝ZLIB.DLL - >從互聯網複製到C:\ Windows \ SysWOW64 - >相同的結果

有人可以幫助我這個toppic?

+0

可能已有問題的重複。在這裏檢查 [已被問過的問題](http://stackoverflow.com/questions/35161398/cant-compile-libpng-1-6-on-windows-via-cmake-cannot-open-include-file-zlib-h ) –

+0

我已閱讀了該主題中的所有評論,但沒有一篇在我身邊:'( – Gugy

回答

0

首先得到一封來自PyPI和zlib的源(http://zlib.net/zlib1211.zip) pyminizip的副本,你需要在那之後做幾件事情:

  1. 使用Visual Studio編譯zlibvc解決方案文件(具體方法如下:http://www.tannerhelland.com/5076/compile-zlib-winapi-wapi-stdcall/ ) - 確保你編譯爲正確的平臺(x86/x64 !!)
  2. 將創建的'zlibstat.lib'從ZLibStatRelease子文件夾複製到python軟件包安裝文件夾(setup.py旁邊),並將其重命名爲'zlib.lib

  3. 全部來自zlib的文件夾zlib的源文件(除了makefile)複製到Python包的src子文件夾,包括win32的子文件夾

現在你應該是好去使用安裝」蟒蛇setup.py安裝'