无法通过pip安装枕头

2024-09-25 00:34:22 发布

您现在位置:Python中文网/ 问答频道 /正文

我试图通过pip在我的虚拟环境上为python2安装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)

Tags: installpipinhomebinmainlinuxlib