我正在处理一个 django 项目,现在我想添加一个图像字段,django 要求我使用命令“pip install Pillow”安装 Pillow, 问题是当我运行这个命令时,这个命令也是“sudo install Pillow”我收到消息:
gcc: error: build/temp.linux-x86_64-3.2/libImaging/BoxBlur.o: No such file or directory
error: command 'gcc' failed with exit status 1
----------------------------------------
Command "/usr/bin/python3.2 -c "import setuptools, tokenize;__file__='/tmp/pip-build-otvko5/Pillow/setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /tmp/pip-5430vf-record/install-record.txt --single-version-externally-managed --compile" failed with error code 1 in /tmp/pip-build-otvko5/Pillow
我已经尝试了我在互联网上找到的所有方法以及其他安装 Pillow 的方法,例如 easy_install,但每次我都会遇到新问题。
请您参考如下方法:
尝试在您的 linux 中运行以下命令
sudo apt-get update
sudo apt-get install python-dev
sudo apt-get install libevent-dev
