我正在尝试通过 pip 安装 pybloomfiltermmap 版本 0.3.14(它位于虚拟机 ubuntu 16.04 上)
sudo pip install pybloomfiltermmap==0.3.14
但我收到一个错误,但我不知道为什么或者如何解决它:
rptk99@ubuntu:~/w3af$ sudo pip install pybloomfiltermmap==0.3.14
The directory '/home/rptk99/.cache/pip/http' or its parent directory is not owned by the current user and the cache has been disabled. Please check the permissions and owner of that directory. If executing pip with sudo, you may want sudo's -H flag.
The directory '/home/rptk99/.cache/pip' or its parent directory is not owned by the current user and caching wheels has been disabled. check the permissions and owner of that directory. If executing pip with sudo, you may want sudo's -H flag.
Collecting pybloomfiltermmap==0.3.14
Downloading pybloomfiltermmap-0.3.14.tar.gz (446kB)
100% |████████████████████████████████| 450kB 313kB/s
Installing collected packages: pybloomfiltermmap
Running setup.py install for pybloomfiltermmap ... error
Complete output from command /usr/bin/python -u -c "import setuptools, tokenize;__file__='/tmp/pip-build-VUo2JI/pybloomfiltermmap/setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /tmp/pip-uyHOdy-record/install-record.txt --single-version-externally-managed --compile:
info: Building from C
running install
running build
running build_ext
building 'pybloomfilter' extension
creating build
creating build/temp.linux-x86_64-2.7
creating build/temp.linux-x86_64-2.7/src
x86_64-linux-gnu-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fno-strict-aliasing -Wdate-time -D_FORTIFY_SOURCE=2 -g -fstack-protector-strong -Wformat -Werror=format-security -fPIC -I/usr/include/python2.7 -c src/mmapbitarray.c -o build/temp.linux-x86_64-2.7/src/mmapbitarray.o
x86_64-linux-gnu-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fno-strict-aliasing -Wdate-time -D_FORTIFY_SOURCE=2 -g -fstack-protector-strong -Wformat -Werror=format-security -fPIC -I/usr/include/python2.7 -c src/bloomfilter.c -o build/temp.linux-x86_64-2.7/src/bloomfilter.o
src/bloomfilter.c:11:14: warning: always_inline function might not be inlinable [-Wattributes]
BloomFilter *bloomfilter_Create_Malloc(size_t max_num_elem, double error_rate,
^
x86_64-linux-gnu-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fno-strict-aliasing -Wdate-time -D_FORTIFY_SOURCE=2 -g -fstack-protector-strong -Wformat -Werror=format-security -fPIC -I/usr/include/python2.7 -c src/md5.c -o build/temp.linux-x86_64-2.7/src/md5.o
x86_64-linux-gnu-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fno-strict-aliasing -Wdate-time -D_FORTIFY_SOURCE=2 -g -fstack-protector-strong -Wformat -Werror=format-security -fPIC -I/usr/include/python2.7 -c src/primetester.c -o build/temp.linux-x86_64-2.7/src/primetester.o
x86_64-linux-gnu-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fno-strict-aliasing -Wdate-time -D_FORTIFY_SOURCE=2 -g -fstack-protector-strong -Wformat -Werror=format-security -fPIC -I/usr/include/python2.7 -c src/MurmurHash3.cpp -o build/temp.linux-x86_64-2.7/src/MurmurHash3.o
cc1plus: warning: command line option ‘-Wstrict-prototypes’ is valid for C/ObjC but not for C++
x86_64-linux-gnu-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fno-strict-aliasing -Wdate-time -D_FORTIFY_SOURCE=2 -g -fstack-protector-strong -Wformat -Werror=format-security -fPIC -I/usr/include/python2.7 -c src/pybloomfilter.c -o build/temp.linux-x86_64-2.7/src/pybloomfilter.o
In file included from src/pybloomfilter.c:348:0:
/usr/include/python2.7/pythread.h:5:1: warning: ‘always_inline’ attribute ignored [-Wattributes]
typedef void *PyThread_type_lock;
^
src/pybloomfilter.c:828:1: warning: function declaration isn’t a prototype [-Wstrict-prototypes]
__PYX_EXTERN_C DL_IMPORT(int) errno;
^
creating build/lib.linux-x86_64-2.7
c++ -pthread -shared -Wl,-O1 -Wl,-Bsymbolic-functions -Wl,-Bsymbolic-functions -Wl,-z,relro -fno-strict-aliasing -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -Wdate-time -D_FORTIFY_SOURCE=2 -g -fstack-protector-strong -Wformat -Werror=format-security -Wl,-Bsymbolic-functions -Wl,-z,relro -Wdate-time -D_FORTIFY_SOURCE=2 -g -fstack-protector-strong -Wformat -Werror=format-security build/temp.linux-x86_64-2.7/src/mmapbitarray.o build/temp.linux-x86_64-2.7/src/bloomfilter.o build/temp.linux-x86_64-2.7/src/md5.o build/temp.linux-x86_64-2.7/src/primetester.o build/temp.linux-x86_64-2.7/src/MurmurHash3.o build/temp.linux-x86_64-2.7/src/pybloomfilter.o -lcrypto -o build/lib.linux-x86_64-2.7/pybloomfilter.so
/usr/bin/ld: cannot find -lcrypto
collect2: error: ld returned 1 exit status
error: command 'c++' failed with exit status 1
----------------------------------------
Command "/usr/bin/python -u -c "import setuptools, tokenize;__file__='/tmp/pip-build-VUo2JI/pybloomfiltermmap/setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /tmp/pip-uyHOdy-record/install-record.txt --single-version-externally-managed --compile" failed with error code 1 in /tmp/pip-build-VUo2JI/pybloomfiltermmap/
rptk99@ubuntu:~/w3af$
我该如何解决这个问题?
答案1
/usr/bin/ld: cannot find -lcrypto
-lcrypto
方法libcrypto.so
解决方案:
sudo apt-get install libssl-dev
答案2
使用以下方式安装 pybloomfiltermmap 0.3.14-0.1.deb
Launchpad 上的这个包。
或者
sudo apt-get install build-essential libssl-dev libffi-dev python-dev
pip install pybloomfiltermmap