2017-03-01 193 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安装'