我正在关注有关如何从here首次向Django提供补丁的教程。在为django的测试套件安装依赖项时遇到错误。到目前为止,我已经遵循了文档中提到的所有内容。当我执行此命令时:
(djangodev) apoorv@apoorv:~/django_dev_copy/django/tests$ pip install -r requirements/py3.txt
安装过程中途出现错误:
running install
running build
running build_py
creating build
creating build/lib.linux-x86_64-3.6
creating build/lib.linux-x86_64-3.6/pylibmc
copying src/pylibmc/test.py -> build/lib.linux-x86_64-3.6/pylibmc
copying src/pylibmc/__init__.py -> build/lib.linux-x86_64-3.6/pylibmc
copying src/pylibmc/client.py -> build/lib.linux-x86_64-3.6/pylibmc
copying src/pylibmc/__main__.py -> build/lib.linux-x86_64-3.6/pylibmc
copying src/pylibmc/consts.py -> build/lib.linux-x86_64-3.6/pylibmc
copying src/pylibmc/pools.py -> build/lib.linux-x86_64-3.6/pylibmc
running build_ext
building '_pylibmc' extension
creating build/temp.linux-x86_64-3.6
creating build/temp.linux-x86_64-3.6/src
gcc -pthread -B /home/apoorv/anaconda3/compiler_compat -Wl,--sysroot=/ -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -fPIC -DUSE_ZLIB -I/home/apoorv/.virtualenvs/djangodev/include -I/home/apoorv/anaconda3/include/python3.6m -c src/_pylibmcmodule.c -o build/temp.linux-x86_64-3.6/src/_pylibmcmodule.o -fno-strict-aliasing -std=c99
In file included from src/_pylibmcmodule.c:34:0:
src/_pylibmcmodule.h:42:10: fatal error: libmemcached/memcached.h: No such file or directory
#include <libmemcached/memcached.h>
^~~~~~~~~~~~~~~~~~~~~~~~~~
compilation terminated.
error: command 'gcc' failed with exit status 1
----------------------------------------
Command "/home/apoorv/.virtualenvs/djangodev/bin/python -u -c "import
setuptools, tokenize;__file__='/tmp/pip-install-
wjutkj18/pylibmc/setup.py';f=getattr(tokenize, 'open', open)
(__file__);code=f.read().replace('\r\n',
'\n');f.close();exec(compile(code, __file__, 'exec'))" install --
record /tmp/pip-record-pveaeajs/install-record.txt --single-version-
externally-managed --compile --install-headers
/home/apoorv/.virtualenvs/djangodev/include/site/python3.6/pylibmc"
failed with error code 1 in /tmp/pip-install-wjutkj18/pylibmc/
我不知道为什么会这样。在教程中,它说:“如果在安装过程中遇到错误,则您的系统可能缺少对一个或多个Python软件包的依赖性。请查阅失败软件包的文档或在网络上搜索遇到的错误消息。”
我在这里想念什么?我正在使用Ubuntu 18.04。 Anaconda Python 3.6.5。