Re: Issues installing Python 2.7

2014-12-01 Thread billyfurlong
This actually worked!!  It's a bare machine with nothing (except the system) 
using python.
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Issues installing Python 2.7

2014-12-01 Thread Chris Angelico
On Tue, Dec 2, 2014 at 3:40 AM,  billyfurl...@gmail.com wrote:
 This actually worked!!  It's a bare machine with nothing (except the system) 
 using python.

Good to know! But, uhh... *what* actually worked? You've posted with
no content, so we have no idea which of the several suggestions in
this thread worked - and,more importantly, neither does anyone who
comes reading the archive. One of the beauties of a good mailing list
is that information hangs around; if anyone else has the same problem
as you do, s/he can read the response and know what to do, without
waiting for the turn-around time of email questions and answers. For
that to work, context is crucial.

But I'm glad you're sorted out!

ChrisA
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Issues installing Python 2.7

2014-11-27 Thread Steven D'Aprano
On Wed, 26 Nov 2014 09:09:30 -0800, billyfurlong wrote:

 ./configure --prefix=/opt/python2.7 --enable-shared

Do you need to install to /opt instead of the default of 
/usr/local/bin? I have multiple versions of Python installed on a Red Hat 
system (Centos, but RH should be the same) using the default prefix of 
/usr/local/bin and don't have any trouble.


I recommend you try again with just:


./configure
make
make altinstall


then add an alias to your .bashrc 

alias python=python2.7


and see how that works for you.


-- 
Steven
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Issues installing Python 2.7

2014-11-27 Thread Chris Angelico
On Fri, Nov 28, 2014 at 4:40 AM, Dennis Lee Bieber
wlfr...@ix.netcom.com wrote:
 On Thu, 27 Nov 2014 11:53:10 +1100, Steven D'Aprano
 steve+comp.lang.pyt...@pearwood.info declaimed the following:

billyfurl...@gmail.com wrote:


 Add this to the bashrc
 export PATH=$PATH:/opt/python2.7/bin/

I'm not so sure about that, but I don't have time to investigate right now.

 If this is for the user login (and where it won't conflict with the
 system startup processes) I'd have swapped the $PATH and /opt... order --
 putting the 2.7 bin directory ahead of the system bin directory.

I wouldn't. Do you know, for absolute certain, which programs you run
that end up calling on Python, perhaps via #!/usr/bin/env python, or
perhaps by being shell scripts and running python my_main_module.py,
or something? You'd break those. Unless, of course, you're making
absolutely sure there's no python command in the /opt/... directory,
in which case the PATH order won't have any semantic difference, and
directory caching will make sure there's virtually no performance
difference, so the current form is just as good.

That said, I have never compiled a Python 2, ever. I've always
compiled Py3, and let that happily take over the name python3,
leaving the system Python 2.x on the name python and python2.

ChrisA
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Issues installing Python 2.7

2014-11-26 Thread Chris Angelico
On Thu, Nov 27, 2014 at 4:09 AM,  billyfurl...@gmail.com wrote:
 Hi all,

 Not a python user but I'm trying to upgrade python so I can install pip which 
 is required for one of the apps that I'm installing.

 I've tried to install using the below instructions, but when I type python I 
 still get the old 2.4.3 version.  Oh Red Hat 5.8 is where I'm installing on.

Since RHEL depends on Python's stability, you'll continue to get the
old version when you just type 'python'. Changing that would
potentially break hundreds of scripts in your system. You're
definitely going to have to type 'python2.7' to get the new version.

 yum groupinstall development tools -y
 yum install readline-devel openssl-devel gmp-devel ncurses-devel gdbm-devel \
 glib-devel expat-devel libGL-devel tk tix gcc-c++ \
 libX11-devel glibc-devel bzip2 tar tcl-devel tk-devel pkgconfig \
 tix-devel bzip2-devel sqlite-devel autoconf db4-devel libffi-devel \
 valgrind-devel -y
 mkdir tmp
 cd tmp
 wget http://python.org/ftp/python/2.7.5/Python-2.7.5.tgz
 tar xvfz Python-2.7.5.tgz
 cd Python-2.7.5

Hmm, you just grabbed 2.7.5, but there's a 2.7.8 (and 2.7.9 is in RC,
coming soon). I don't think it'll make much difference here, but you
may as well grab the latest stable.

 ./configure --prefix=/opt/python2.7 --enable-shared

 make

 make altinstall

It's been a while since I built a Python 2 from source, but I suspect
'make altinstall' is safe, and the --prefix to configure is
unnecessary. However... my suspicion is that you simply need to
reference the shared library from the same directory.

 Add this to the bashrc
 export PATH=$PATH:/opt/python2.7/bin/


 [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

See if that file exists somewhere in /opt/python2.7 - if it does, you
may simply need to add that directory to ld.so.conf (or ld.so.conf.d
if that's how your system's set up) and rerun ldconfig.

Alternatively, you should be able to run Python directly from the
build tree. If that works, you know for sure that it's a simple
pathing problem.

ChrisA
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Issues installing Python 2.7

2014-11-26 Thread Steven D'Aprano
billyfurl...@gmail.com wrote:

 Hi all,
 
 Not a python user but I'm trying to upgrade python so I can install pip
 which is required for one of the apps that I'm installing.
 
 I've tried to install using the below instructions, but when I type python
 I still get the old 2.4.3 version.  Oh Red Hat 5.8 is where I'm installing
 on.

That's good! That means you didn't break the system python, which would be
bad.

It's probably possible *in principle* to teach Red Hat Linux to use Python
2.7 as the only version of Python installed, but that will probably break a
lot of critical system scripts like yum. The safest way to deal with this
issue is to 

Your options are:

- upgrade the OS to a more recent version which supports 2.7 out of the box;

- explicitly refer to python2.7 instead of python

- use an alias, I put this in my bashrc:

alias python='python2.7'


 yum groupinstall development tools -y
 yum install readline-devel openssl-devel gmp-devel ncurses-devel
 gdbm-devel \ glib-devel expat-devel libGL-devel tk tix gcc-c++ \
 libX11-devel glibc-devel bzip2 tar tcl-devel tk-devel pkgconfig \
 tix-devel bzip2-devel sqlite-devel autoconf db4-devel libffi-devel \
 valgrind-devel -y
 mkdir tmp
 cd tmp
 wget http://python.org/ftp/python/2.7.5/Python-2.7.5.tgz
 tar xvfz Python-2.7.5.tgz
 cd Python-2.7.5
 
 ./configure --prefix=/opt/python2.7 --enable-shared
 
 make
 
 make altinstall

So far this all looks good to me.


 Add this to the bashrc
 export PATH=$PATH:/opt/python2.7/bin/

I'm not so sure about that, but I don't have time to investigate right now.


 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.

Are you sure that /opt/python2.7/bin/python2.7 even exists? What do ls -l
and file say about them?



-- 
Steven

-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Issues installing Python 2.7

2014-11-26 Thread Michael Torrie
To further explain my terse post from before (from my phone), see below.

On 11/26/2014 10:09 AM, billyfurl...@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.



-- 
https://mail.python.org/mailman/listinfo/python-list