Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #81616

Re: Issues installing Python 2.7

Date 2014-11-26 21:04 -0700
From Michael Torrie <torriem@gmail.com>
Subject Re: Issues installing Python 2.7
References <2680a96a-f5a9-44d8-b4b1-6e0ca32a53ed@googlegroups.com>
Newsgroups comp.lang.python
Message-ID <mailman.16359.1417061067.18130.python-list@python.org> (permalink)

Show all headers | View raw


To further explain my terse post from before (from my phone), see below.

On 11/26/2014 10:09 AM, billyfurlong@gmail.com wrote:
> Now the installation worked fine but shouldn't I see that it's using the correct version???
> 
> I also did try to run /opt/python2.7/bin/python2.7 and it give me this.
> 
> [root@wmy machine bin]# python2.7
> python2.7: error while loading shared libraries: libpython2.7.so.1.0: cannot open shared object file: No such file or directory
> 
> Please help the newb.  He's frustrated.

So the longer answer is that only certain directories are searched by
Linux for shared libraries. Python happens to provide a shared library,
which it depends on, which is installed by the source tarball in /opt
along with the binaries.  There are a number of ways you can solve this:

- Create a file in /etc/ld.so.conf.d/python2.7.conf and place in it the
following path:
/opt/python2.7/lib

- before running /opt/python2.7/bin/python2.7, set the LD_LIBRARY_PATH
environment variable (example in bash):
$ LD_LIBRARY_PATH=/opt/python2.7/lib /opt/python2.7/bin/python2.7

- create a wrapper script in /usr/bin that sets LD_LIBRARY_PATH and
execs python2.7

I recommend the first as a permanent solution.


Back to comp.lang.python | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread


Thread

Issues installing Python 2.7 billyfurlong@gmail.com - 2014-11-26 09:09 -0800
  Re: Issues installing Python 2.7 Chris Angelico <rosuav@gmail.com> - 2014-11-27 10:47 +1100
  Re: Issues installing Python 2.7 Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2014-11-27 11:53 +1100
    Re: Issues installing Python 2.7 Dennis Lee Bieber <wlfraed@ix.netcom.com> - 2014-11-27 12:40 -0500
    Re: Issues installing Python 2.7 Chris Angelico <rosuav@gmail.com> - 2014-11-28 09:40 +1100
  Re: Issues installing Python 2.7 Michael Torrie <torriem@gmail.com> - 2014-11-26 21:04 -0700
  Re: Issues installing Python 2.7 Steven D'Aprano <steve@pearwood.info> - 2014-11-27 08:13 +0000
    Re: Issues installing Python 2.7 billyfurlong@gmail.com - 2014-12-01 08:40 -0800
      Re: Issues installing Python 2.7 Chris Angelico <rosuav@gmail.com> - 2014-12-02 03:50 +1100

csiph-web