复现代码时遇到的问题(实在不懂都9102了还用2009最后更新的库,而且还是py2!!!)
首先 Murmur 0.1.3 是用C++写的,
直接pip install murmur或者把源码下到本地用1
2
缺少C++环境,[可以在此下载](https://www.microsoft.com/en-us/download/confirmation.aspx?id=44266)
error: Microsoft Visual C++ 9.0 is required…1
2
3
装好环境之后再执行,缺少zlib.h库
murmur/include\unzip.h(53) : fatal error C1083: Cannot open include file: ‘zlib.h’: No such file or directory1
2
3
4
5
6
7
8所以还是要下源码= =!
于是把zlib.h继续下到本地放进源码正确的位置中,后续还是出现了很多问题。
![](https://raw.githubusercontent.com/herasu/blog_pic/master/error.png)
最终解决办法:
1. 在murmur/include/crypt.h开头添加两句
#ifndef __MURMUR_CRYPT_H
#define __MURMUR_CRYPT_H1
2
3
4
5
6
7
8
![](https://raw.githubusercontent.com/herasu/blog_pic/master/addtwolines.png)
最后添加endif
![](https://raw.githubusercontent.com/herasu/blog_pic/master/endif.png)
2. 再下载一个zlib.h
apt install zlib1g-dev1
2
3
4
![](https://raw.githubusercontent.com/herasu/blog_pic/master/apt.png)
3. 就可以安装了!
python setup.py build
python setup.py install`