开发者

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开发者_运维知识库!


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
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜