当前位置:首页 » 编程语言 » 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 11:47:53 浏览:633
电脑配置都有哪些问题 发布:2024-11-08 11:15:29 浏览:727
新浪微博敏感词数据库 发布:2024-11-08 11:03:22 浏览:472
linux的终端软件 发布:2024-11-08 11:01:46 浏览:204
主机如何把密码关掉 发布:2024-11-08 10:36:25 浏览:720
安卓软件如何锁定 发布:2024-11-08 10:30:27 浏览:709
sql定时执行语句 发布:2024-11-08 10:29:36 浏览:673
迈锐宝xl值得入手哪个配置 发布:2024-11-08 10:14:13 浏览:634
寻欢加密 发布:2024-11-08 10:02:57 浏览:353
拼单源码 发布:2024-11-08 09:58:24 浏览:143