當前位置:首頁 » 編程語言 » linux升級python

linux升級python

發布時間: 2023-02-16 14:27:04

linux怎麼升級python版本

能在線用yum安裝更新就用yum,不能就下載個新版本的rpm包,用rpm命令,安裝上就OK了。

② linux 修改默認Python為Python3

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

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

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

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

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

先刪除默認的Python軟鏈接:

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

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

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

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

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

完畢。

③ linux怎麼升級python版本

如果是redhat/centos, 使用sudo yum -y update即可. 如果源里的新版本不能達到你的要求, 你可以去python.org下載最新版並手動編譯, 如果python.org里的最新版仍不能達到你的要求, 你可以對源碼進行修改編譯並測試.

④ 求助kali Linux上怎麼升級Python

操作方法如下: 1.#vim /etc/apt/sources.list 2.復制上面的軟體源到sources.list中 3.屏蔽或刪除之前的軟體源 4.退出並保存 5.運行以下命令 [html] view plain #apt-get update [html] view plain #apt-get dist-upgrade 6.運行重啟...

⑤ linux 下怎麼更新 python版本

如果是redhat/centos, 使用sudo yum -y update即可.
如果源里的新版本不能達到你的要求, 你可以去python.org下載最新版並手動編譯, 如果python.org里的最新版仍不能達到你的要求, 你可以對源碼進行修改編譯並測試.

⑥ linux python 升級後 怎麼用pip安裝模塊

linux版本太老了。升級一下也很容易。通常升級到2.7就可以了。然後重新安裝cx_Oracle到python2.7目錄里。不過你的arcgis既然有自己的python解釋器,也當然有自己的包管理。你其實不需要重新安裝python2.7隻需要在arcgis環境里,執行它那個python2.7解釋器,安裝一個cx_Oracle到它自己的包管理目錄里就可以了。

⑦ 求助kali Linux上怎麼升級Python

操作方法如下:
1.#vim /etc/apt/sources.list
2.復制上面的軟體源到sources.list中
3.屏蔽或刪除之前的軟體源
4.退出並保存
5.運行以下命令
[html] view plain
#apt-get update
[html] view plain
#apt-get dist-upgrade

6.運行重啟命令即可。(#reboot)

⑧ red hat怎麼升級python

從今天開始學習Python!看了一下虛擬機RedHat中的python,發現還是原生的2.4.3,所以決定升級一下
[root@linuxidc ~]# python
Python 2.4.3 (#1, May 5 2011, 16:39:10)
[GCC 4.1.2 20080704 (Red Hat 4.1.2-50)] on linux2
Type "help", "right", "credits" or "license" for more information.
>>>
[root@linuxidc ~]#
1.下載z最新版本的python
[root@linuxidc ~]# wget http://python.org/ftp/python/2.7.6/Python-2.7.6.tgz
2.解壓及編譯
[root@linuxidc ~]# tar xvf Python-2.7.2.tar.bz2
[root@linuxidc Python-2.7.6]# ./configure --prefix=/usr/local/python27
[root@linuxidc Python-2.7.6]# make
[root@linuxidc Python-2.7.6]# make install
[root@linuxidc Python-2.7.6]# ls /usr/local/python27/ -al
total 28
drwxr-xr-x 6 root root 4096 Mar 21 01:01 .
drwxr-xr-x 13 root root 4096 Mar 21 01:01 ..
drwxr-xr-x 2 root root 4096 Mar 21 01:01 bin
drwxr-xr-x 3 root root 4096 Mar 21 01:01 include
drwxr-xr-x 4 root root 4096 Mar 21 01:01 lib
drwxr-xr-x 3 root root 4096 Mar 21 01:01 share
3.覆蓋原有的python鏈接
[root@linuxidc Python-2.7.6]# mv /usr/bin/python /usr/bin/python_old
[root@linuxidc Python-2.7.6]# ln -s /usr/local/python27/bin/python /usr/bin/
[root@linuxidc Python-2.7.6]# python
Python 2.7.6 (default, Mar 21 2014, 01:00:09)
[GCC 4.1.2 20080704 (Red Hat 4.1.2-44)] on linux2
Type "help", "right", "credits" or "license" for more information.
>>>
此時已經可以正常使用python2.7了,但是因為yum是使用的2.4的版本來用的,現在輸入一下yum就會報錯
[root@linuxidc Python-2.7.6]# yum
There was a problem importing one of the Python moles
required to run yum. The error leading to this problem was:
No mole named yum
Please install a package which provides this mole, or
verify that the mole is installed correctly.
It's possible that the above mole doesn't match the
current version of Python, which is:
2.7.6 (default, Mar 21 2014, 01:00:09)
[GCC 4.1.2 20080704 (Red Hat 4.1.2-44)]
If you cannot solve this problem yourself, please go to
the yum faq at:
http://wiki.linux.ke.e/YumFaq
5.修改yum
[root@linuxidc Python-2.7.6]# vim /usr/bin/yum
#!/usr/bin/python #修改此處為2.4的位置
[root@linuxidc Python-2.7.6]# vim /usr/bin/yum
#!/usr/bin/python2.4
yum 可以使用了!
[root@linuxidc Python-2.7.6]# yum
Loaded plugins: rhnplugin, security
You need to give some command
usage: yum [options] COMMAND
List of Commands:
check-update Check for available package updates
clean Remove cached data
deplist List a package's dependencies
erase Remove a package or packages from your system
groupinfo Display details about a package group
groupinstall Install the packages in a group on your system
grouplist List available package groups
groupremove Remove the packages in a group from your system
help Display a helpful usage message
info Display details about a package or group of packages
info-security Returns security data for the packages listed, that affects your system
install Install a package or packages on your system
list List a package or groups of packages
list-security Returns security data for the packages listed, that affects your system
localinstall Install a local RPM
makecache Generate the metadata cache
provides Find what package provides the given value
reinstall reinstall a package
repolist Display the configured software repositories
resolvedep Determine which package provides the given dependency
search Search package details for the given string
shell Run an interactive yum shell
update Update a package or packages on your system
update-minimal Works like update, but goes to the 'newest' package match which fixes a problem that affects your system
upgrade Update packages taking obsoletes into account

options:
-h, --help show this help message and exit
-t, --tolerant be tolerant of errors
-C run entirely from cache, don't update cache
-c [config file] config file location
-R [minutes] maximum command wait time
-d [debug level] debugging output level
--showplicates show plicates, in repos, in list/search commands
-e [error level] error output level
-q, --quiet quiet operation
-v, --verbose verbose operation
-y answer yes for all questions
--version show Yum version and exit
--installroot=[path] set install root
--enablerepo=[repo] enable one or more repositories (wildcards allowed)
--disablerepo=[repo] disable one or more repositories (wildcards allowed)
-x [package], --exclude=[package]
exclude package(s) by name or glob
--disableexcludes=[repo]
disable exclude from main, for a repo or for
everything
--obsoletes enable obsoletes processing ring updates
--noplugins disable Yum plugins
--nogpgcheck disable gpg signature checking
--disableplugin=[plugin]
disable plugins by name
--enableplugin=[plugin]
enable plugins by name
--skip-broken skip packages with depsolving problems
--security Include security relevant packages
--cve=CVE Include packages needed to fix the given CVE
--bz=BZ Include packages needed to fix the given BZ
--advisory=ADVISORY Include packages needed to fix the given advisory
[root@linuxidc Python-2.7.6]#

⑨ linux怎麼把python2升級到3

Python2和Python3是可以共存在同一個Linux系統上的,所以直接安裝Python3即可。而且Python2在Linux上也是非常重要的,可能你的系統上就有許多程序依賴Python2呢,所以Python2很有必要繼續保留在你的Linux系統上。

⑩ 請問如何將Linux得python3.5.2升級到python3.6-3.7啊

安裝python可使用命令sudo apt install python3,
嘗試使用sudo apt upgrade python來更新。

拓展:

sudo apt install <包名>可安裝軟體;
sudo apt upgrade <包名>可升級軟體;
sudo apt autoremove <包名>可卸載軟體

熱點內容
悠悠解壓 發布:2024-11-08 14:06:54 瀏覽:371
低頻訪問存儲 發布:2024-11-08 14:05:31 瀏覽:679
html5坦克大戰源碼 發布:2024-11-08 14:04:35 瀏覽:406
輸錯密碼鎖定什麼意思 發布:2024-11-08 14:02:07 瀏覽:541
存儲計算邏輯 發布:2024-11-08 13:49:35 瀏覽:543
java演算法排序演算法 發布:2024-11-08 13:42:20 瀏覽:883
u盤隨身系統linux 發布:2024-11-08 13:34:34 瀏覽:411
b1422壓縮機鎖定 發布:2024-11-08 13:32:43 瀏覽:635
上傳按鈕圖片 發布:2024-11-08 13:30:57 瀏覽:920
安卓手機相機如何拍攝短視頻 發布:2024-11-08 13:28:42 瀏覽:411