Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
702 views
in Technique[技术] by (71.8m points)

installing python 2.7.11 on CentOS7 which already has python 2.7.5 is not working

CentOS7 has python 2.7.5 by default.

$ which python
/usr/bin/python
$ python --version
Python 2.7.5

But I needed to use python 2.7.11.
So I installed that version from source.

$ wget https://www.python.org/ftp/python/2.7.11/Python-2.7.11.tgz
$ tar xf Python-2.7.11.tgz
$ cd Python-2.7.11

$ ./configure --prefix=/usr/local --enable-shared
$ make
$ sudo make install

Output of which command have changed.
But python version is still 2.7.5.

$ which python
/usr/local/bin/python
$ python --version
Python 2.7.5

So I want to know why this happened and how to fix this situation.

question from:https://stackoverflow.com/questions/65842897/installing-python-2-7-11-on-centos7-which-already-has-python-2-7-5-is-not-workin

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

I've solved this like below.

$ bash -c 'echo "/usr/local/lib" >> /etc/ld.so.conf'
$ sudo /sbin/ldconfig

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...