【发布时间】:2014-06-13 06:41:05
【问题描述】:
我的问题开始时与此相同:Python executable not finding libpython shared library
我用export LD_LIBRARY_PATH=$HOME/local/lib/python/2.7.6/lib 更新了.bashrc,一切都很好。 Python 工作,我安装了 pip。但是现在,我在使用 pip 安装 cython 时遇到了类似的情况。我在执行pip install cython 时收到此错误消息:
gcc -pthread -shared build/temp.linux-x86_64-2.7/tmp/pip_build/cython/Cython/Plex/Scanners.o -L. -lpython2.7 -o build/lib.linux-x86_64-2.7/Cython/Plex/Scanners.so
/usr/bin/ld: cannot find -lpython2.7
collect2: ld returned 1 exit status
error: command 'gcc' failed with exit status 1
我无法将$HOME/local/lib/python/2.7.6/lib 添加到/etc/ld.so.conf 并运行ldconfig,因为我没有root。我的印象是设置 LD_LIBRARY_PATH 是解决这个问题的方法,但这似乎不适用于编译。有没有办法让编译器在不运行 root 命令的情况下查看这个本地库?
【问题讨论】: