ReviewBoard pip 安装失败

Posted

技术标签:

【中文标题】ReviewBoard pip 安装失败【英文标题】:ReviewBoard pip installation failure 【发布时间】:2016-09-25 18:26:54 【问题描述】:

我正在尝试在 14.04.1-Ubuntu 上安装 ReviewBoard,但出现以下错误。我用过命令:

sudo apt-get install python-setuptools python-dev memcached patch libjpeg-dev
sudo pip install -U pip
sudo easy_install pip
sudo apt-get install python-mysqldb
sudo pip install ReviewBoard

File "/usr/lib/python2.7/distutils/command/build_ext.py", line 337, in run self.build_extensions()
File "/tmp/pip-build-84i3OO/Pillow/setup.py", line 512, in build_extensions' using --disable-%s, aborting' % (f, f))
ValueError: zlib is required unless explicitly disabled using --disable-zlib, aborting

Command "/usr/bin/python -u -c "import setuptools, tokenize;__file__='/tmp/pip-build-84i3OO/Pillow/setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /tmp/pip-5lU4Yb-record/install-record.txt --single-version-externally-managed --compile" failed with error code 1 in /tmp/pip-build-84i3OO/Pillow/
/usr/local/lib/python2.7/dist-packages/pip/_vendor/requests/packages        
/urllib3/util/ssl_.py:122: InsecurePlatformWarning: A true SSLContext object is not available. This prevents urllib3 from configuring SSL appropriately and may cause certain SSL connections to fail. You can upgrade to a newer version of Python to solve this. For more information, see https://urllib3.readthedocs.org/en/latest/security.html#insecureplatformwarning.
InsecurePlatformWarning

有什么想法为什么会发生以及如何解决它?

编辑

安装好的枕头(https://discuss.erpnext.com/t/new-python-dependency-pillow-if-you-get-error-during-update-see-this-post/7900):

sudo apt-get install -y libtiff5-dev libjpeg8-dev zlib1g-dev libfreetype6-dev liblcms2-dev libwebp-dev tcl8.6-dev tk8.6-dev python-tk
sudo pip install pillow

现在得到:

x86_64-linux-gnu-gcc -pthread -fno-strict-aliasing -DNDEBUG -g -fwrapv -O2 -                                                                                                                                                             Wall -Wstrict-prototypes -fPIC -DUSE__THREAD -I/usr/include/ffi -I/usr/include/l                                                                                                                                                             ibffi -I/usr/include/python2.7 -c c/_cffi_backend.c -o build/temp.linux-x86_64-2                                                                                                                                                             .7/c/_cffi_backend.o
c/_cffi_backend.c:15:17: fatal error: ffi.h: No such file or directory
 #include <ffi.h>
                 ^
compilation terminated.
error: command 'x86_64-linux-gnu-gcc' failed with exit status 1

Command "/usr/bin/python -u -c 
"import setuptools, tokenize;__file__='/tmp/pip-build-hB90D2/cffi/setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /tmp/pip-CCyW5e-record/install-record.txt --single-version-externally-managed --compile" 
failed with error code 1 in /tmp/pip-build-hB90D2/cffi/

【问题讨论】:

【参考方案1】:

你试过安装libffi-devel

apt-get install libffi-dev

有时要修复 pip 问题,安装 build-essentialpython-dev 很有用

apt-get install python-dev && apt-get install build-essential

祝你好运!

【讨论】:

谢谢。这帮助我安装了 couchapp python 工具。 还帮忙安装了sudo pip install rdbtools python-lzf【参考方案2】:

使用 (https://discuss.erpnext.com/t/new-python-dependency-pillow-if-you-get-error-during-update-see-this-post/7900) 安装枕头:

sudo apt-get install -y libtiff5-dev libjpeg8-dev zlib1g-dev libfreetype6-dev liblcms2-dev libwebp-dev tcl8.6-dev tk8.6-dev python-tk
sudo pip install pillow

然后 ccfi 使用 (Failed to install Python Cryptography package with PIP and setup.py):

sudo apt-get install libffi-dev libssl-dev libpython2.7-dev
sudo pip install cryptography
sudo pip install cffi

【讨论】:

【参考方案3】:

要在 CentOS 7 上运行 Python 2.7 Fabric 1.13,我必须先安装 openssl-devel。

完全错误:

#include <openssl/opensslv.h>
                              ^
compilation terminated.
error: command 'gcc' failed with exit status 1

----------------------------------------
Command "/usr/bin/python -u -c "import setuptools, tokenize;__file__='/tmp/pip-build-2hTQUe/cryptography/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-mqFBbh-record/install-record.txt --single-version-externally-managed --compile" failed with error code 1 in /tmp/pip-build-2hTQUe/cryptography/

解决方案:

sudo yum install -y gcc make openssl openssl-devel
sudo pip install fabric

【讨论】:

以上是关于ReviewBoard pip 安装失败的主要内容,如果未能解决你的问题,请参考以下文章

Centos6.7 安装ReviewBoard 问题记录

mac安装pip失败的解决办法

在 Pandas 上安装 Pip 失败?

python2上的pip安装失败

python之 pyCharm pip安装pandas库失败

解决CentOS7-python-pip安装失败