问题描述
我正在尝试安装库pyleargist
.它需要手动安装另一个我已安装的库libfftw3
.由于我没有root特权,因此必须在主目录~/usr/include
和~/usr/lib
下安装libfftw3
.然后,我关注这篇文章: https://superuser.com/questions/242190/如何在OS-x上安装matplotlib ,
I'm trying to install a library pyleargist
. It requires another lib libfftw3
to be manually installed which I've installed. Since I don't have the root privilege, I have to install libfftw3
under my home directory: ~/usr/include
and ~/usr/lib
. Then I follow this post: https://superuser.com/questions/242190/how-to-install-matplotlib-on-os-x, added:
export LDFLAGS="-L~/usr/lib"
export CFLAGS="-I~/usr/include
pip
知道必须参考/usr
才能获取include( .h文件)和lib( .a,*.so文件).但是,在运行pip install --user pyleargist
时,它抱怨:
So that pip
knows it have to consult /usr
to get the include (.h files) and lib (.a, *.so files). However, while running pip install --user pyleargist
, it complains about:
gcc-4.4.real: src/leargist.c: No such file or directory
gcc-4.4.real: no input files
error: command 'gcc' failed with exit status 1
我猜发生了什么事,因为路径不正确,因此找不到*.c
文件(我认为pip
应该已经将文件下载到了某个地方,但不确定该文件在哪里).
I guess what happened is that the path is incorrect so that it can't find the *.c
files (I think pip
should have downloaded the file somewhere but not sure where it is).
所以我的问题如下:1)在这种特殊情况下,如何在~/usr
下的include
和lib
路径下安装pyleargist
? 2)更一般的说,如果没有在默认路径中找到pip
,如何为pip
提供附加路径,以便它知道从何处获取附加的包含文件或库?
So my questions are the following: 1) in this particular case, how can I install pyleargist
with include
and lib
path under ~/usr
? 2) more generally, how can one provide additional path for pip
so that it knows where to get the additional include files or libs if not found in the default path?
p.s我在没有sudo
特权的ubuntu
机器上.
p.s I am on an ubuntu
machine without sudo
privilege.
ref:
https://pypi.python.org/pypi/pyleargist/1.0.1
http://www.fftw.org/
ref:
https://pypi.python.org/pypi/pyleargist/1.0.1
http://www.fftw.org/
推荐答案
pip
具有--global-option
标志
您可以使用它将其他标志传递给build_ext
.
You can use it to pass additional flags to build_ext
.
例如,添加-I
标志:
pip install --global-option=build_ext --global-option="-I/home/users/abc/include/" pyOpenSSL
这篇关于点安装自定义包含路径的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!