【问题标题】:Error installing pip package on debian / python 3.4在 debian/python 3.4 上安装 pip 包时出错
【发布时间】:2015-03-22 00:35:52
【问题描述】:

我在我的 debian 7.8 上从源代码编译了 python 3.4。 我已经使用pipvirtualenv(django、pillow 等)安装了一些 Python 包,但是安装python-phonenumbershttps://github.com/daviddrysdale/python-phonenumbers)时出错。 我尝试使用 virtualenv 并没有运行 pip3 install phonenumbers 并手动下载存档并运行python3 setup.py install。每次我得到同样的错误:

Command "/usr/local/bin/python3.4 -c "import setuptools, tokenize;
__file__='/tmp/pip-build-ogsbxm_d/phonenumbers/setup.py';
exec(compile(getattr(tokenize, 'open', open)(__file__)
.read().replace('\r\n', '\n'), __file__, 'exec'))"
install --record /tmp/pip-98gunm55-record/install-record.txt
--single-version-externally-managed --compile"
failed with error code -9 in /tmp/pip-build-ogsbxm_d/phonenumbers

我在我的 Windows 和 ubuntu 14.04 上尝试过 - 一切正常。我该如何解决?

【问题讨论】:

  • /tmp/pip-build-ogsbxm_d/phonenumbers 中有什么内容?
  • 它在我查看之前已被删除

标签: python debian pip python-3.4


【解决方案1】:

对于 Ubuntu 14.04,来自 Docker 映像 python:3.4.3-slim,这个组合对我有用:

sudo apt-get update
sudo apt-get install -y build-essential
sudo apt-get install -y python3.4-dev
sudo apt-get install -y libpq-dev

pip3 install psycopg2

注意build-essential 包。这对我来说至关重要。也许它也会帮助你。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2015-12-21
    • 1970-01-01
    • 2015-05-13
    • 2016-12-11
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多