ProgrammingThis forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Hi. I'm trying to install a python modules that is trying to build something using gcc, but it fails with:
/usr/bin/ld: cannot find -lpython2.7
libpython2.7.so happens to be in an unusually place on my system. I set LD_LIBRARY_PATH to exactly the correct place, but setup.py doesn't seem to care. How to I tell setup.py where it is supposed to find its shared libraries?
The problem is that I did a local Python installation on a system on which I don't have admin privileges, so I can't create symlinks in the normal spot. (They were using a really ancient version of Python, and I wanted the latest.) I used Nix to install Python locally, and I know exactly where it put the shared library, but I don't know how to get setup.py to use it.
I think that creating a local ~/bin directory an putting the correct value in it might work. You should, of course, make sure that your PATH value starts with ~/bin
Here's the standard values on my (old) laptop, running Fedora 18.
~ $ type -p python
~ $ file $(type -p python)
/usr/bin/python: symbolic link to `python2'
~ $ file $(type -p python2)
/usr/bin/python2: symbolic link to `python2.7'
~ $ file $(type -p python2.7)
/usr/bin/python2.7: ELF 32-bit LSB executable, Intel 80386, version 1 (SYSV), dynamically linked (uses shared libs), for GNU/Linux 2.6.32, BuildID[sha1]=0xf872fc2e1f49b9b747a4ebd45265dc72a707cb3e, stripped
Maybe I misunderstood your response, but I do not think it addresses my specific problem. I do not have any problems executing my custom version of Python. My PATH is already set correctly for that and the correct binary launches. The problem is that, when I try to build a module using "python setup.py", the setup.py program cannot find the custom version of the libpython2.7.so shared library. I know where it is, and I set LD_LIBRARY_PATH to make it available, but setup.py does not seem to be respecting this.