Customize Include Path for Pip Installation



I am attempting to install a library, denoted as


, which has a dependency on another library,


. I have manually installed the latter library, as I lack root privileges. To install


, I must install it under my home directory, specifically at




. To aid in the installation process, I followed the instructions outlined in this post:, and added the necessary components.

export LDFLAGS="-L~/usr/lib"
export CFLAGS="-I~/usr/include 

To ensure proper inclusion of files (.h and .a/*.so) in


, it is necessary to refer to


. Despite this,

pip install --user pyleargist

raises an error message indicating a problem.

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

It seems like the incorrect path is causing the inability to locate the


files. It is unclear where


may have downloaded the file.

I have a couple of questions. Firstly, in this situation, what is the process for installing


along with




in the


path? Secondly, in a more general sense, how can


be given extra paths to locate include files or libraries if they are not present in the default path?

I want to inform you that I am currently using an


machine which does not grant me



The following references are available:
– PyLeArgist version 1.0.1 can be found at
– The fastest fourier transform in the west (FFTW) can be found at

Solution 1:

The flag of


is associated with



It is possible to utilize it for transmitting extra flags to



To illustrate, to include a marker with the code



pip install --global-option=build_ext --global-option="-I/home/users/abc/include/" pyOpenSSL

Solution 2:

This thread provided valuable assistance. Additionally, by appending the


flag, you can utilize pip without requiring root privileges.

pip install --global-option="-I/home/users/abc/include/" mpi4py --user

If you’re utilizing python-v2.7, then the mentioned instruction installs the python bundle into



Solution 3:

In case you lack root access, you can still obtain a virtual environment without the need for root. Moreover, the path to the virtual environment will be located in the home directory.

curl -O
tar xvfz virtualenv-1.10.1.tar.gz
cd virtualenv-1.10.1.tar.gz
python myVE

then your path is set in your home:

cd myVE/bin
>>> import sys
>>> sys.path
['', '/home/foobar/temp/virtualenv-1.10.1/myVE/lib/', '/home/foobar/temp/virtualenv-1.10.1/myVE/lib/python3.3', '/home/foobar/temp/virtualenv-1.10.1/myVE/lib/python3.3/plat-linux', '/home/foobar/temp/virtualenv-1.10.1/myVE/lib/python3.3/lib-dynload', '/usr/lib64/python3.3', '/usr/lib/python3.3', '/usr/lib/python3.3/plat-linux', '/home/foobar/temp/virtualenv-1.10.1/myVE/lib/python3.3/site-packages']

Frequently Asked Questions