首页 > 系统相关 >How to Install Python on Linux

How to Install Python on Linux

时间:2022-11-30 11:31:30浏览次数:61  
标签:Sep Python python asc How 3.4 Install 2013


Summary

Hostmonster uses the preinstalled version of Python that ships with CentOS. Because of this it is often not the latest release. This article will explain how to install an updated version of python locally.

Download Python

Enter the following commands to download and extract Python 2.7 to your hosting account. 

下载安装的过程基本在这里

1.建立一个文件夹保存下载的压缩包,进入之后下载;

2.然后解压缩

3.进入解压缩之后的文件夹准备安装

mkdir ~/python
cd ~/python
wget http://www.python.org/ftp/python/3.4.0/Python-3.4.0b1.tgz
tar zxfv Python-3.4.0b1.tgz
find ~/python -type d | xargs chmod 0755
cd Python-3.4

Install Python

Once extracted you can use the following commands to configure and install Python.

./configure --prefix=$HOME/python
make
make install

5.开始安装

Modify the .bashrc

For your local version of python to load you will need to add it to the .bashrc file.

vim ~/.bashrc

Press i ,than Enter:

export PATH=$HOME/python/bin:$PATH

Write the changes and close vim:

:wq

Press Enter

source ~/.bashrc

Note: You may need to logout for the environment to update.

Enter ​​python -V​​ to check the version of python installed.

6.设置环境变量。

【注意】 以上的操作都完成之后,但是由于linux原来就有一个版本的 python,这时候查看版本会发现,仍然是原来的版本,新的还是看不到。需要作如下操作。

1.再将原来/usr/bin/python链接改为别的名字

​1​

​mv​​​ ​​/usr/bin/python /usr/bin/python_old​

2.解压的新版的 python文件夹下,安装完成之后会有一个 /bin/​​python​​   

把这个移动到原来链接位置(链接过去 ln)

再建立新版本python的链接

​1​

​ln​​​ ​​-s /新版python的路径​​​​/bin/python2.7 /usr/bin/python​

3. 现在ok了,可以查询了。

   python -V        可以看到信版本了

 Python 3.4.0b1 (default, Jan 20 2014, 20:35:22)
[GCC 4.4.3] on linux
Type "help", "copyright", "credits" or "license" for more information.
import 'atexit' # <class '_frozen_importlib.BuiltinImporter'>
# destroy atexit
>>>




​http://www.python.org/ftp/python/3.4.0​

Index of /ftp/python/3.4.0

​Name​

​Last modified​

​Size​

​Description​

​Parent Directory​

 

-

 

​Python-3.4.0a1.tar.bz2​

04-Aug-2013 04:36

13M

 

​Python-3.4.0a1.tar.bz2.asc​

04-Aug-2013 04:36

836

 

​Python-3.4.0a1.tar.xz​

04-Aug-2013 04:36

11M

 

​Python-3.4.0a1.tar.xz.asc​

04-Aug-2013 04:36

836

 

​Python-3.4.0a1.tgz​

04-Aug-2013 04:36

16M

 

​Python-3.4.0a1.tgz.asc​

04-Aug-2013 04:36

836

 

​Python-3.4.0a2.tar.bz2​

07-Sep-2013 14:13

13M

 

​Python-3.4.0a2.tar.bz2.asc​

07-Sep-2013 14:16

836

 

​Python-3.4.0a2.tar.bz2.md5​

07-Sep-2013 14:15

32

 

​Python-3.4.0a2.tar.xz​

07-Sep-2013 14:15

11M

 

​Python-3.4.0a2.tar.xz.asc​

07-Sep-2013 14:16

836

 

​Python-3.4.0a2.tar.xz.md5​

07-Sep-2013 14:15

32

 

​Python-3.4.0a2.tgz​

07-Sep-2013 14:13

16M

 

​Python-3.4.0a2.tgz.asc​

07-Sep-2013 14:16

836

 

​Python-3.4.0a2.tgz.md5​

07-Sep-2013 14:15

32

 

​Python-3.4.0a3.tar.bz2​

30-Sep-2013 01:21

13M

 

​Python-3.4.0a3.tar.bz2.asc​

30-Sep-2013 01:24

836

 

​Python-3.4.0a3.tar.bz2.md5​

30-Sep-2013 01:23

32

 

​Python-3.4.0a3.tar.xz​

30-Sep-2013 01:23

11M

 

​Python-3.4.0a3.tar.xz.asc​

30-Sep-2013 01:24

836

 

​Python-3.4.0a3.tar.xz.md5​

30-Sep-2013 01:23

32

 

​Python-3.4.0a3.tgz​

30-Sep-2013 01:20

16M

 

​Python-3.4.0a3.tgz.asc​

30-Sep-2013 01:24

836

 

​Python-3.4.0a3.tgz.md5​

30-Sep-2013 01:23

32

 

​Python-3.4.0a4.tar.bz2​

21-Oct-2013 00:50

14M

 

​Python-3.4.0a4.tar.bz2.asc​

21-Oct-2013 00:53

836

 

​Python-3.4.0a4.tar.bz2.md5​

21-Oct-2013 00:53

32

 

​Python-3.4.0a4.tar.xz​

21-Oct-2013 00:53

12M

 

​Python-3.4.0a4.tar.xz.asc​

21-Oct-2013 00:53

836

 

​Python-3.4.0a4.tar.xz.md5​

21-Oct-2013 00:53

32

 

​Python-3.4.0a4.tgz​

21-Oct-2013 00:50

16M

 

​Python-3.4.0a4.tgz.asc​

21-Oct-2013 00:53

836

 

​Python-3.4.0a4.tgz.md5​

21-Oct-2013 00:53

32

 

​Python-3.4.0b1.tar.bz2​

24-Nov-2013 21:37

15M

 

​Python-3.4.0b1.tar.bz2.asc​

24-Nov-2013 21:37

836

 

​Python-3.4.0b1.tar.bz2.md5​

24-Nov-2013 21:37

32

 

​Python-3.4.0b1.tar.xz​

24-Nov-2013 21:37

13M

 

​Python-3.4.0b1.tar.xz.asc​

24-Nov-2013 21:37

836

 

​Python-3.4.0b1.tar.xz.md5​

24-Nov-2013 21:37

32

 

​Python-3.4.0b1.tgz​

24-Nov-2013 21:37

18M

 

​Python-3.4.0b1.tgz.asc​

24-Nov-2013 21:37

836

 

​Python-3.4.0b1.tgz.md5​

24-Nov-2013 21:37

32

 

​Python-3.4.0b2.tar.xz​

05-Jan-2014 21:40

13M

 

​Python-3.4.0b2.tar.xz.asc​

05-Jan-2014 21:40

836

 

​Python-3.4.0b2.tar.xz.md5​

05-Jan-2014 21:40

32

 

​Python-3.4.0b2.tgz​

05-Jan-2014 21:40

18M

 

​Python-3.4.0b2.tgz.asc​

05-Jan-2014 21:40

836

 

​Python-3.4.0b2.tgz.md5​

05-Jan-2014 21:40

32

 

​python-3.4.0a1-macosx10.5.dmg​

03-Aug-2013 22:33

19M

 

​python-3.4.0a1-macosx10.5.dmg.asc​

03-Aug-2013 22:47

487

 

​python-3.4.0a1-macosx10.6.dmg​

03-Aug-2013 23:09

19M

 

​python-3.4.0a1-macosx10.6.dmg.asc​

03-Aug-2013 23:18

487

 

​python-3.4.0a1-pdb.zip​

03-Aug-2013 23:11

33M

 

​python-3.4.0a1-pdb.zip.asc​

08-Sep-2013 19:52

203

 

​python-3.4.0a1.amd64-pdb.zip​

03-Aug-2013 23:12

22M

 

​python-3.4.0a1.amd64-pdb.zip.asc​

03-Aug-2013 23:14

203

 

​python-3.4.0a1.amd64.msi​

03-Aug-2013 23:12

20M

 

​python-3.4.0a1.amd64.msi.asc​

03-Aug-2013 23:14

203

 

​python-3.4.0a1.msi​

03-Aug-2013 23:11

20M

 

​python-3.4.0a1.msi.asc​

08-Sep-2013 19:53

203

 

​python-3.4.0a2-macosx10.5.dmg​

07-Sep-2013 19:27

19M

 

​python-3.4.0a2-macosx10.5.dmg.asc​

07-Sep-2013 19:32

487

 

​python-3.4.0a2-macosx10.6.dmg​

07-Sep-2013 20:02

22M

 

​python-3.4.0a2-macosx10.6.dmg.asc​

07-Sep-2013 20:22

487

 

​python-3.4.0a2-pdb.zip​

08-Sep-2013 19:50

33M

 

​python-3.4.0a2-pdb.zip.asc​

08-Sep-2013 19:57

203

 

​python-3.4.0a2.amd64-pdb.zip​

08-Sep-2013 19:51

22M

 

​python-3.4.0a2.amd64-pdb.zip.asc​

08-Sep-2013 19:52

203

 

​python-3.4.0a2.amd64.msi​

08-Sep-2013 19:51

20M

 

​python-3.4.0a2.amd64.msi.asc​

08-Sep-2013 19:52

203

 

​python-3.4.0a2.msi​

08-Sep-2013 19:50

20M

 

​python-3.4.0a2.msi.asc​

08-Sep-2013 19:56

203

 

​python-3.4.0a3-macosx10.5.dmg​

29-Sep-2013 02:02

19M

 

​python-3.4.0a3-macosx10.5.dmg.asc​

29-Sep-2013 02:05

487

 

​python-3.4.0a3-macosx10.6.dmg​

29-Sep-2013 02:29

22M

 

​python-3.4.0a3-macosx10.6.dmg.asc​

29-Sep-2013 02:34

487

 

​python-3.4.0a3-pdb.zip​

29-Sep-2013 19:51

33M

 

​python-3.4.0a3-pdb.zip.asc​

29-Sep-2013 19:54

203

 

​python-3.4.0a3.amd64-pdb.zip​

29-Sep-2013 19:51

22M

 

​python-3.4.0a3.amd64-pdb.zip.asc​

29-Sep-2013 19:54

203

 

​python-3.4.0a3.amd64.msi​

29-Sep-2013 19:51

20M

 

​python-3.4.0a3.amd64.msi.asc​

29-Sep-2013 19:54

203

 

​python-3.4.0a3.msi​

29-Sep-2013 19:51

20M

 

​python-3.4.0a3.msi.asc​

29-Sep-2013 19:54

203

 

​python-3.4.0a4-macosx10.5.dmg​

20-Oct-2013 11:21

19M

 

​python-3.4.0a4-macosx10.5.dmg.asc​

20-Oct-2013 11:25

487

 

​python-3.4.0a4-macosx10.6.dmg​

20-Oct-2013 11:50

23M

 

​python-3.4.0a4-macosx10.6.dmg.asc​

20-Oct-2013 11:55

487

 

​python-3.4.0a4-pdb.zip​

20-Oct-2013 20:04

34M

 

​python-3.4.0a4-pdb.zip.asc​

20-Oct-2013 20:38

203

 

​python-3.4.0a4.amd64-pdb.zip​

20-Oct-2013 20:05

22M

 

​python-3.4.0a4.amd64-pdb.zip.asc​

20-Oct-2013 20:38

203

 

​python-3.4.0a4.amd64.msi​

20-Oct-2013 20:05

21M

 

​python-3.4.0a4.amd64.msi.asc​

20-Oct-2013 20:38

203

 

​python-3.4.0a4.msi​

20-Oct-2013 20:04

20M

 

​python-3.4.0a4.msi.asc​

20-Oct-2013 20:37

203

 

​python-3.4.0b1-macosx10.5.dmg​

24-Nov-2013 20:25

21M

 

​python-3.4.0b1-macosx10.5.dmg.asc​

24-Nov-2013 20:28

487

 

​python-3.4.0b1-macosx10.6.dmg​

24-Nov-2013 20:46

21M

 

​python-3.4.0b1-macosx10.6.dmg.asc​

24-Nov-2013 20:51

487

 

​python-3.4.0b1-pdb.zip​

24-Nov-2013 19:11

35M

 

​python-3.4.0b1-pdb.zip.asc​

24-Nov-2013 19:22

203

 

​python-3.4.0b1.amd64-pdb.zip​

24-Nov-2013 19:21

23M

 

​python-3.4.0b1.amd64-pdb.zip.asc​

24-Nov-2013 19:22

203

 

​python-3.4.0b1.amd64.msi​

24-Nov-2013 19:21

23M

 

​python-3.4.0b1.amd64.msi.asc​

24-Nov-2013 19:22

203

 

​python-3.4.0b1.msi​

24-Nov-2013 19:11

23M

 

​python-3.4.0b1.msi.asc​

24-Nov-2013 19:22

203

 

​python-3.4.0b2-macosx10.5.dmg​

05-Jan-2014 19:20

21M

 

​python-3.4.0b2-macosx10.5.dmg.asc​

05-Jan-2014 19:37

473

 

​python-3.4.0b2-macosx10.6.dmg​

05-Jan-2014 20:09

21M

 

​python-3.4.0b2-macosx10.6.dmg.asc​

05-Jan-2014 20:55

473

 

​python-3.4.0b2-pdb.zip​

05-Jan-2014 16:25

35M

 

​python-3.4.0b2-pdb.zip.asc​

05-Jan-2014 16:28

203

 

​python-3.4.0b2.amd64-pdb.zip​

05-Jan-2014 16:14

23M

 

​python-3.4.0b2.amd64-pdb.zip.asc​

05-Jan-2014 16:28

203

 

​python-3.4.0b2.amd64.msi​

05-Jan-2014 16:14

24M

 

​python-3.4.0b2.amd64.msi.asc​

05-Jan-2014 16:28

203

 

​python-3.4.0b2.msi​

05-Jan-2014 16:25

23M

 

​python-3.4.0b2.msi.asc​

05-Jan-2014 16:28

203

 

​python340a1.chm​

03-Aug-2013 23:04

6.4M

 

​python340a1.chm.asc​

03-Aug-2013 23:13

203

 

​python340a2.chm​

08-Sep-2013 19:44

6.5M

 

​python340a2.chm.asc​

08-Sep-2013 19:52

203

 

​python340a3.chm​

29-Sep-2013 19:46

6.5M

 

​python340a3.chm.asc​

29-Sep-2013 19:54

203

 

​python340a4.chm​

20-Oct-2013 19:51

6.5M

 

​python340a4.chm.asc​

20-Oct-2013 20:38

203

 

​python340b1.chm​

24-Nov-2013 19:03

6.6M

 

​python340b1.chm.asc​

24-Nov-2013 19:22

203

 

​python340b2.chm​

05-Jan-2014 16:04

6.8M

 

​python340b2.chm.asc​

05-Jan-2014 16:28

203

 

Apache/2.2.16 (Debian) Server at www.python.org Port 80




标签:Sep,Python,python,asc,How,3.4,Install,2013
From: https://blog.51cto.com/u_15726470/5897979

相关文章

  • Python工具箱系列(十七)
    很多软件工程师都认为MD5是一种加密算法,然而这种观点是不对的。作为一个1992年第一次被公开的算法,到今天为止已经被发现了一些致命的漏洞。本文讨论MD5在密码保存方面的......
  • showdoc本地部署
    ShowDoc就是一个非常适合IT团队的在线文档分享工具,使用的是一款非常轻量级的关系数据库系统SQLite,支持多数SQL92标准。它可以加快团队之间沟通的效率。但是把所有的接口文......
  • python编辑excel表格文件的简单方法练习
    一、创建一个Excel文件fromopenpyxlimportWorkbook#需要用到openpyxl模块来操作Excel文件。openpyxl需要先安装。#实例化对象wb=Workbook()#获取当前active的shee......
  • PYTHON 数据结构 - 元组
    1.1数据结构一般常用的有数组(Array),集合(Set),列表(List),队列(Queue),链表(Linkedlist),树(Tree),堆(Heap),栈(Stack),字典(Dictionary)Python中数据结构主要有序列,集合,字典......
  • 教你用Python制作BMI计算器
    案例介绍欢迎来到我的小院,我是霍大侠,恭喜你今天又要进步一点点了!我们来用Python相关知识,做一个BMI计算器的案例。你可以通过控制台的提示信息,输入身高和体重,注意单位,系......
  • Python接口自动化核心模块 - 数据库操作和日志
    每天进步一点点,关注我们哦,每天分享测试技术文章本文章出自【码同学软件测试】码同学公众号:自动化软件测试,领取资料可加:magetest码同学抖音号:小码哥聊软件测试进行接口......
  • v-if和v-show的区别
    v-if 和 v-show的区别v-if 是“真实的”按条件渲染,因为它确保了在切换时,条件区块内的事件监听器和子组件都会被销毁与重建。v-if 也是惰性的:如果在初次渲染时条件值......
  • idea报错Plugin ‘Vue.js‘ is incompatible with this installation
    1.报错原因:下载的插件的版本和idea不匹配2.进入http://plugins.jetbrains.com搜索需要的插件vue.js3.找到idea对应版本再下载4.安装即可......
  • Python爬取m3u8视频(多线程)- OK好用,代码在文章尾
    摘自:https://www.cnblogs.com/python147/p/14511627.html1.前言本文的文字及图片来源于网络,仅供学习、交流使用,不具有任何商业用途,如有问题请及时联系我们以作处理。......
  • 网上一个哥们写的,使用Python写一个m3u8多线程下载器 -- 没用起来
    摘自:https://blog.csdn.net/muslim377287976/article/details/104340242/ 文章目录I.挖坑缘由II.功能/更新记录III.代码1.GUI2.下载工具类3.逻辑代码IV.下载地址I.挖坑......