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
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
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).
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 I am on an ubuntu
machine without sudo
privilege.
ref:
https://pypi.python.org/pypi/pyleargist/1.0.1
http://www.fftw.org/
if you dont have root you can get a virtual enviroment no root is needed to get one and your path will be in home
then your path is set in your home:
This was a helpful thread. Just to add on to this, you can also use pip without root if you pass the
--user
flag at the end:For example, if you're using python-v2.7, the above command installs the python package to
/home/username/.local/lib/python2.7/site-packages
pip
has a--global-option
flagYou can use it to pass additional flags to
build_ext
.For instance, to add a
-I
flag: