manually building installing python packages in linux so they are recognized
<p>My system is SLES 11.4 having python 2.6.9.
I know little about python and have not found where to download rpm's that give me needed python packages.<br>
I acquired numpy 1.4 and 1.11 and I believe did a successful <code>python setup.py build</code> followed by <code>python setup.py install</code> on numpy.
Going from memory I think this installed under <code>/usr/local/lib64/python2.6/...</code></p>

<p>Next I tried building &amp; installing matplotlib (which requires numpy) and when I do <code>python setup.py build</code> it politely responds with cannot find numpy.  So my questions are</p>

<p>do i need to set some kind of python related environment variable, something along the lines of LD_LIBRARY_PATH or PATH ?</p>

<p>As I get more involved with using python installing packages that I have to build from source I need to understand where things currently are per the default install of python, where new things should go, and where the core settings for python are to know how and where to recognize new packages.</p>

<p>think i figured it out.  Apparently SLES 11.4 does not include the development headers in the default install from their SDK for numpy 1.8.
And of course they don't offer matplotlib along with a bunch of common python packages.</p>

<p>The python packages per the SLES SDK are the system default are located under<code>/usr/lib64/python2.6/site-packages/</code> and it is under here I see numpy version 1.8.  So using the YAST software manager if you choose various python packages this is where they are located.</p>

<p>To this point without having the <strong>PYTHONPATH</strong> environment variable set I can launch python, type import numpy, and for the most part use it.  But if I try to build matplotlib 0.99.1 it responds that it cannot find the header files for numpy version 1.8, so it knows numpy 1.8 is installed but the development package needs to be installed.</p>

<p>Assuming by development headers they mean .h files,
If I search under <code>/usr/lib64/python2.6/site-packages</code> I have no .h files for anything!</p>

<p>I just downloaded the source for numpy-1.8.0.tar.gz  and easily did a <code>python setup.py.build</code> followed by <code>python setup.py install</code> and noticed it installed under <code>/usr/local/lib64/python2.6/site-packages/</code></p>

<p>Without the <strong>PYTHONPATH</strong> environment variable set, if i try to build matplotlib I still get the error about header files not found.</p>

<p>but in my bash shell, as root, after I do <code>export PYTHONPATH=/usr/local/lib64/python2.6/site-packages</code> I can successfully do the build and install of matplotlib 0.99.1 which also installs <code>/usr/local/lib64/python2.6/site-packages</code></p>

<p>Notes:</p>

<p>I also just did a successful build &amp; install of numpy-1.11 and that got thrown in under <code>/usr/local/lib64/python2.6/site-packages</code> however when i try to then build matplotlib 0.99.1 with PYTHONPATH set it reports outright that numpy is not installed that version 1.1 or greater is needed.  So here it seems this older version of matplotlib needs to use a certain version range of numpy, that the latest numpy 1.11 is not compatible.</p>

<p>And the only other environment variable i have which is set by the system is <strong>PYTHONSTARTUP</strong> which points to the file <code>/etc/pythonstart</code>.</p>

python