【问题标题】:Error installing gnureadline via pip通过 pip 安装 gnureadline 时出错
【发布时间】:2014-05-18 12:27:46
【问题描述】:

我在尝试升级到 IPython 2.0 时破坏了我的 IPython 设置。安装gnureadline 时安装失败。我最初有this problem,但我修复了它。现在我收到此错误:

cc -bundle -undefined dynamic_lookup -arch x86_64 -arch i386 -Wl,-F. -Qunused-arguments -Qunused-arguments build/temp.macosx-10.9-intel-2.7/Modules/2.x/readline.o readline/libreadline.a readline/libhistory.a -lncurses -o build/lib.macosx-10.9-intel-2.7/gnureadline.so

clang: error: no such file or directory: 'readline/libreadline.a'

clang: error: no such file or directory: 'readline/libhistory.a'

error: command 'cc' failed with exit status 1

----------------------------------------
Cleaning up...
Command /usr/bin/python -c "import setuptools;__file__='/private/var/folders/jj/0w0dd3n16jq4g5579g6c7h040000gn/T/pip_build_root/gnureadline/setup.py';exec(compile(open(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /var/folders/jj/0w0dd3n16jq4g5579g6c7h040000gn/T/pip-iJITYv-record/install-record.txt --single-version-externally-managed failed with error code 1 in /private/var/folders/jj/0w0dd3n16jq4g5579g6c7h040000gn/T/pip_build_root/gnureadline
Storing complete log in /Users/mc/Library/Logs/pip.log

感谢您的帮助。

【问题讨论】:

    标签: python linux pip


    【解决方案1】:

    sudo apt-get install libncurses5-dev

    参考: Ipython no readline available and pip install readline error

    【讨论】:

    • 安装在终端sudo apt-get install libncurses5-dev,它工作正常,然后pip install gnureadline==6.3.3
    【解决方案2】:

    除上述之外。 libffi 包为我整理好了。

    sudo apt-get install libncurses5-dev libffi-dev
    

    【讨论】:

      【解决方案3】:

      在 OSX 10.14.5 上 -

      brew install ncurses
      

      然后

      pip install gnureadline
      

      【讨论】:

        【解决方案4】:

        在终端安装 sudo apt-get install libncurses5-dev,它工作正常,然后 pip install gnureadline==6.3.3

        【讨论】:

          【解决方案5】:

          对于 Fedora 用户:

          dnf install ncurses-devel
          

          【讨论】: