Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to install Python3.5

2025-04-05 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >

Share

Shulou(Shulou.com)06/02 Report--

This article is about how to install Python 3.5. Xiaobian thinks it is quite practical, so share it with everyone for reference. Let's follow Xiaobian and have a look.

1. Unpack

[root@monit Python]# tar -xzf Python-3.5.2.tgz

2 is moved

[root@monit Python]# mv Python-3.5.2 /usr

[root@monit usr]# mkdir SoftWare

[root@monit usr]# mv mysql-* SoftWare/

[root@monit usr]# mv Python-3.5.2/ SoftWare/

3 Compilation

[root@monit SoftWare]# cd Python-3.5.2/

[root@monit Python-3.5.2]#./ configure --prefix=/usr/local/python3

[root@monit Python-3.5.2]# make && make install

4 Setting environment variables

echo 'export PATH=$PATH:/usr/local/python3/bin' >> ~/.bashrc

4. Replace Python2

The purpose of this is to type python calls into any directory of the system that is python 3 commands, not the system default 2.6.6 commands. However, this will also cause yum that depends on python 2.6 to not be used, so you have to modify the yum configuration.

[root@monit bin]# rm /usr/bin/python

rm: remove regular file `/usr/bin/python'? y

[root@monit Python-3.5.2]# ln -sv /usr/local/python3/bin/python3.5 /usr/bin/python

At this point, under the/usr/bin directory is (ll), which contains the following files| grep python), which has a python 2.6, just need to specify yum configuration python point here

[root@monit bin]# ll /usr/bin | grep python

-rwxr-xr-x 1 root root 11040 Aug 14 2013 abrt-action-analyze-python

lrwxrwxrwx 1 root root 19 Aug 7 20:47 python -> /usr/local/python3/

lrwxrwxrwx. 1 root root 6 Aug 7 12:54 python2 -> python

-rwxr-xr-x 1 root root 9032 Sep 4 2013 python2.6

Modify yum configuration via vim #!/ /bin/python changed to #!/ /usr/bin/python2.6, save exit.

[root@monit bin]# vim /usr/bin/yum

Thank you for reading! About "how to install Python 3.5" this article is shared here, I hope the above content can be of some help to everyone, so that everyone can learn more knowledge, if you think the article is good, you can share it to let more people see it!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Development

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report