Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
707 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 Reply

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

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...