ProgrammingThis forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.
Notices
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.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
Hi. I'm trying to install a python modules that is trying to build something using gcc, but it fails with:
Code:
/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.
Code:
~ $ type -p python
/usr/bin/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
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.
Code:
~ $ type -p python
/usr/bin/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.
to the Setup file it should work. Putting that in the CFLAGS environment variable should also work.
It seems like there could be a way to add this setting to some kind configuration file so it will be added automatically, but the docs are somewhat vague about the syntax.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.