Python 无法通过pip安装枕头

Python 无法通过pip安装枕头,python,debian,pip,virtualenv,pillow,Python,Debian,Pip,Virtualenv,Pillow,我正试图在虚拟环境中通过pip为python2安装python映像库“Pillow”,但在命令pip install Pillow后,我得到错误: /usr/bin/ld: /usr/lib/x86_64-linux-gnu/libz.a(deflate.o): relocation R_X86_64_32S against `_length_code' can not be used when making a shared object; recompile with -fPIC /usr

我正试图在虚拟环境中通过pip为python2安装python映像库“Pillow”,但在命令
pip install Pillow
后,我得到错误:

/usr/bin/ld: /usr/lib/x86_64-linux-gnu/libz.a(deflate.o): relocation R_X86_64_32S against `_length_code' can not be used when making a shared object; recompile with -fPIC

/usr/lib/x86_64-linux-gnu/libz.a: error adding symbols: Bad value

collect2: error: ld returned 1 exit status

error: command 'x86_64-linux-gnu-gcc' failed with exit status 1

----------------------------------------
Cleaning up...
Command /home/bartek/.virtualenvs/delme/bin/python2 -c "import setuptools, tokenize;__file__='/tmp/pip-build-coqv_d/PILlow/setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /tmp/pip-eppBL6-record/install-record.txt --single-version-externally-managed --compile --install-headers /home/bartek/.virtualenvs/delme/include/site/python2.7 failed with error code 1 in /tmp/pip-build-coqv_d/PILlow
Traceback (most recent call last):
  File "/home/bartek/.virtualenvs/delme/bin/pip", line 11, in <module>
    sys.exit(main())
  File "/home/bartek/.virtualenvs/delme/local/lib/python2.7/site-packages/pip/__init__.py", line 248, in main
    return command.main(cmd_args)
  File "/home/bartek/.virtualenvs/delme/local/lib/python2.7/site-packages/pip/basecommand.py", line 161, in main
    text = '\n'.join(complete_log)
UnicodeDecodeError: 'ascii' codec can't decode byte 0xe2 in position 28: ordinal not in range(128)
/usr/bin/ld:/usr/lib/x86_64-linux-gnu/libz.a(deflate.o):在创建共享对象时,不能根据“长度代码”重新定位R_x86_64_32S;用-fPIC重新编译
/usr/lib/x86_64-linux-gnu/libz.a:添加符号时出错:错误值
collect2:错误:ld返回了1个退出状态
错误:命令“x86_64-linux-gnu-gcc”失败,退出状态为1
----------------------------------------
清理。。。
Command/home/bartek/.virtualenvs/delme/bin/python2-c“导入setuptools,tokenize;uu文件uu=”/tmp/pip-build-coqv_ud/PILlow/setup.py';exec(编译(getattr(tokenize,'open',open)(u文件u).read().replace('\r\n','\n'),u文件u,'exec'))”安装--record/tmp/pip-eppBL6-record/install-record.txt--外部管理的单一版本--编译--install headers/home/bartek/.virtualenvs/delme/include/site/python2.7失败,错误代码为/tmp/pip-build-coqv_d/PILlow中的1
回溯(最近一次呼叫最后一次):
文件“/home/bartek/.virtualenvs/delme/bin/pip”,第11行,在
sys.exit(main())
文件“/home/bartek/.virtualenvs/delme/local/lib/python2.7/site packages/pip/_init__.py”,第248行,主文件
return command.main(cmd_args)
文件“/home/bartek/.virtualenvs/delme/local/lib/python2.7/site packages/pip/basecommand.py”,主目录第161行
text='\n'.连接(完成日志)
UnicodeDecodeError:“ascii”编解码器无法解码第28位的字节0xe2:序号不在范围内(128)

枕头的pip配方似乎被打破了,因为它没有添加编译x86_64代码所需的标志(
-fPIC
)。报告一个bug。另外:为什么您要在本地安装
pip
而不是
python-pip
提供的安装?@umläute我使用virtualenv提供的pip,因为我想在多个virtualenv之间进行版本控制,并且我不想在主python解释器中安装piw,就像pip的pip配方在它没有添加编译x86_64代码所需的标志(
-fPIC
)。报告一个bug。另外:为什么要在本地安装
pip
而不是
python-pip
提供的安装?@umläute我使用virtualenv提供的pip,因为我想在多个virtualenv之间控制版本,我不想安装到主python解释器