當前位置:首頁 » 編程語言 » linuxpython查看版本

linuxpython查看版本

發布時間: 2023-03-12 13:05:38

linux查看版本命令問題

Linux下查看版本號的命令

1,查看內核版本命令:

cat /proc/version

uname -a

uname -rcat /etc/issue

man uname

2,查看linux版本:抄錄如下:

1) 登錄到伺服器執行 lsb_release -a ,即可列出所有版本信息,例如:

[[email protected] ~]# lsb_release -a

LSB Version: 1.3

Distributor ID: RedHatEnterpriseAS

Descrīption: Red Hat Enterprise Linux AS release 4 (Nahant Update 1)

Release: 4

Codename: NahantUpdate1

[[email protected] ~]#

這個命令適用於所有的linux,包括Redhat、SuSE、Debian等發行版。

2) 登錄到linux執行cat /etc/redhat-release ,例如如下:

[[email protected] ~]# cat /etc/redhat-release

Red Hat Enterprise Linux AS release 4 (Nahant Update 1)

[[email protected] ~]#

這種方式下可以直接看到具體的版本號,比如 AS4 Update 1

3)登錄到linux執行rpm -q redhat-release ,例如如下

[[email protected] ~]# rpm -q redhat-release

redhat-release-4AS-2.4

[[email protected] ~]#

這種方式下可看到一個所謂的release號,比如上邊的例子是2.4

這個release號和實際的版本之間存在一定的對應關系,如下:

redhat-release-3AS-1 -> Redhat Enterprise Linux AS 3

redhat-release-3AS-7.4 -> Redhat Enterprise Linux AS 3 Update 4

redhat-release-4AS-2 -> Redhat Enterprise Linux AS 4

redhat-release-4AS-2.4 -> Redhat Enterprise Linux AS 4 Update 1

redhat-release-4AS-3 -> Redhat Enterprise Linux AS 4 Update 2

redhat-release-4AS-4.1 -> Redhat Enterprise Linux AS 4 Update 3

redhat-release-4AS-5.5 -> Redhat Enterprise Linux AS 4 Update 4

更多Linux知識可參考書籍《Linux就該這么學》。

㈡ 怎麼查看linux安裝的python版本

方法一:
(推薦教程:Python入門教程)
執行命令 python -V
方法二:
執行命令 whereis python
方法三:
執行命令 python

㈢ linux 修改默認Python為Python3

先查看自己電腦里的python3版本:

在個人的home目錄中,打開 *.bashrc*文件,打開方式為

沒有安裝gedit文本編輯器的使用如下命令安裝

或者使用vim、nano等。打開後,輸入如下內容:

然後注銷登錄或者輸入如下命令以使命令立刻生效

先刪除默認的Python軟鏈接:

然後創建一個新的軟鏈接指向需要的Python版本:

如果想還原回原python2.7,只需

注意,ln命令的基本用法為:

直接執行下面兩個命令即可:

如果需要改回python2默認,則輸入:

完畢。

㈣ 如何查看linux的python版本

看版本
python --version
看安裝路徑
which python

㈤ linux如何看Python版本

linux如何看Python版本?下面給大家介紹三種方法:

方法一

執行命令:python -V

相關推薦:《Python教程》

方法二

執行命令:whereis python

方法三

執行命令:python

熱點內容
c語言編程與設計 發布:2025-09-18 06:09:15 瀏覽:720
2016年預演算法 發布:2025-09-18 06:07:05 瀏覽:620
什麼是廣告腳本設計 發布:2025-09-18 05:52:09 瀏覽:656
移動版我的世界伺服器 發布:2025-09-18 05:38:49 瀏覽:963
使用jsp腳本輸出九九乘法表 發布:2025-09-18 05:22:11 瀏覽:668
出行解壓 發布:2025-09-18 05:20:54 瀏覽:579
安卓手機畫線怎麼用 發布:2025-09-18 05:16:43 瀏覽:702
解壓吃蔬菜 發布:2025-09-18 05:10:04 瀏覽:823
php判斷數組個數 發布:2025-09-18 04:54:02 瀏覽:669
linuxmd5c 發布:2025-09-18 04:47:04 瀏覽:349