Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Error Installing Python

Upon hitting

make install

I get the following error

/usr/bin/install: cannot create regular file /usr/local/bin/python2.6: Permission denied make: *** [altbininstall] Error 1

I am not the root user so I assume its a permissions issue. I do have my own subfolder at /home/my_username Is there a way to complete the python installation there by giving a more specific command perhaps?

Also Python 2.4 is already installed how do I ensure that I am actually using 2.6?

Thanks alot!

like image 866
algorithmicCoder Avatar asked Dec 16 '22 13:12

algorithmicCoder


1 Answers

The configure script lets you specify --prefix=[dest]. From the usage:

By default, `make install' will install all the files in /usr/local/bin, /usr/local/lib etc. You can specify an installation prefix other than /usr/local using --prefix, for instance --prefix=$HOME.

So to install under py26 in your home directory:

% ./configure --prefix=$HOME/py26
..
% make install
% $HOME/py26/bin/python

To use this on a more permanent basis, add $HOME/bin to your PATH variable in your ~/.bashrc (or other shell rcfile). To verify which Python you're using, do this:

% which python
/home/user/py26/bin/python

Make sure you don't have a typo in the --prefix or the assignment to PATH. For example:

% which python
/usr/bin/python

% ls -1 $HOME/py26/bin/python*
/home/user/py26/bin/python
/home/user/py26/bin/python2.6
/home/user/py26/bin/python2.6-config
/home/user/py26/bin/python-config

% export PATH=$HOME/py26/bin:$PATH
% which python
/home/user/py26/bin/python
like image 80
samplebias Avatar answered Dec 28 '22 01:12

samplebias