0

This is a question regarding building python and its modules on any type of unix-based OS.
When I build python, by default it looks for libraries in /usr/lib, /usr/local/lib etc.
If I want to change the library search path and add my own directory to be searched for before the default paths, how do I do this?
I read that I need to modify setup.py file. Is the lib_dirs to be modified? Like this

lib_dirs = self.compiler.library_dirs + ['/lib64', '/usr/lib64','/lib','/usr/lib']


But modifying this did not help. Is there any other way to this? or am I doing something wrong?

Anthon
  • 69,918
  • 32
  • 186
  • 246
ages04
  • 6,337
  • 4
  • 19
  • 15
  • If you want to search your own directories first, they should probably go at the beginning, not the end... – Amber Feb 21 '11 at 22:41
  • possible duplicate of [How to build 32bit python 2.6 on 64bit Linux ?](http://stackoverflow.com/questions/3867131/how-to-build-32bit-python-2-6-on-64bit-linux) – S.Lott Feb 22 '11 at 01:45

1 Answers1

0

Try modifying the PYTHONPATH environment variable. It's used by the Python interpreter to figure out where to look for libraries/modules to import.

export PYTHONPATH=$PYTHONPATH:/whatever/other/path/you/want

veritessa
  • 51
  • 1
  • 2