当前位置:首页 » 编程语言 » 升级python

升级python

发布时间: 2022-01-08 06:45:59

‘壹’ ubuntu怎么升级python

在ubuntu 的终端中用代码下载最新的Python

sudo apt-get install python3
系统会提示输入linux的密码,输入密码后下载
刚才下载的Python程序被安装在usr/local/lib/python3.5 中

‘贰’ 如何通过pip命令升级python

安装Python包,的确是pip最为方便了,简单快捷,因为它直接是从pypi上面下载文件,保证文件的安全性和可靠性,并且资源丰富;
下面是安装步骤:
下载 setuptools,注意对应 Python 的版本,完成后运行 exe 即可完成安装
https://pypi.python.org/pypi/setuptools/1.4.1
setuptools-1.4.1.win32-py2.6.exe
下载 pip
https://pypi.python.org/pypi/pip
pip-1.4.1.tar.gz
安装 pip
5.1 解压pip-1.4.1.tar.gz
5.2 运行CMD,进入命令行
5.3 用CD命令进入 pip 解压目录
5.4 输入 "python setup.py install"
5.5 添加环境变量 path = C:\Python26\ArcGIS10.0\Scripts
验证是否安装成功,运行CMD,进入命令行,输入pip;
如果出现pip的用法介绍,说明安装成功。
进入命令行,输入 "pip install package",package为安装包名称,就可以随意使用了。

‘叁’ 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]#

‘肆’ 如何从Python 3.4 升级到 Python 3.5

1、首先 我们要确定一下我们当前操作系统中的Python版本.我们在Ubuntu中使用Ctrl+Alt+T 快捷键 调出 终端窗口。然后在终端中输入Python。

‘伍’ python第三方库怎样升级

python第三方包(库)升级方法是:1、利用“pip list --outdated”查看可更新的库;2、利用“pip install --upgrade 要更新的库”命令将需要更新的库进行更新。

一、pip list --outdated查看可更新的库。

Version为当前版本,Latest为最新的库。

二、pip install --upgrade scipy 对准备更新的库进行更新

更新完成

推荐课程:Python基础视频教程( Tornado)

‘陆’ python怎么升级到指定版本

打开软件会看到,这里有明显的红色提示错误。原因是当前使用的是python3.3,当执行print的时候,打印的文字需要小括号’()‘括起来。

在工具栏中找到这个类似扳手加齿轮的图标

找到左侧 project interpreter选项

这里可以看到当前使用的python版本,选择点击向下箭头

这里显示出了可用的python版本和jython版本,jython会将python加载到jvm中执行,一般会慢很多,那这里就选择python2.7

点击apply 和 ok

现在可以看到,没有红色的错误提示,现在pycharm使用的是python2.7。print不要小括号,当然加了也没问题。

‘柒’ mac怎么升级python版本

下载Python3.5 for Mac 一步步安装
安装的默认路径是:/Library/Frameworks/Python.framework/Versions/3.5/
强烈建议不要直接sudo ln -s (会直接覆盖系统原来的link导致想调用自带python的软件出现问题),修改path variable虽然比较安全,但对于你的需要是没有太大必要的。
想要实现你的如下要求

在终端里直接输入“python”命令就会运行3.5的py版本?

直接在.profile加一个alias就可以了。如果你的Terminal运行的shell是bash(默认),可以修改~/.bash_profile,添加下行(具体的path取决于你的python3安装路径):

alias python="/Library/Frameworks/Python.framework/Versions/3.5/bin/python3.5"

然后重启一下Terminal或者直接

source ~/.bash_profile

下面的是我的Mac用户的家目录中的.bash_profile内容,供参考
alias ls='ls -G' -->ls 带有颜色的文件显示alias ll='ls -l' #unalias ls #unalias ll#export CLICOLOR=1export LSCOLORS=exfxaxdxcxegedabagacad --->设置的显示的目录和文件的带颜色的export PATH=$PATH:/usr/local/mysql/bin:/Library/Frameworks/Python.framework/Versions/3.5/binexport PATH# Setting PATH for Python 3.5# The original version is saved in .bash_profile.pysaveexport PATH=$PATH:/Library/Frameworks/Python.framework/Versions/3.5/bin:alias python="/Library/Frameworks/Python.framework/Versions/3.5/bin/python3.5"~
如果想要Python2.7的就把.bash_profile中的最后一行注释掉,要用Python3.5.2的就把.bash_proflle的最后一行生效就好,简单方便,我喜欢。

‘捌’ 如何升级“python requirement already satisfied use”

1、日期/为UTC,以为会是死的简单Python中-包括电池。

2、简单的,除了Python的(2.6)不包括任何类。

3、快速搜索轮番上涨的python-dateutil应该做的正是我需要的。 问题是,我需要在Windows上安装它。能够UPACK的。tar.gz2 7-zip的 CodeGo.net,但现在只剩下一个文件集合,并就如何进行任何指导。当尝试运行setup.py我得到的错误“没有模块setuptools的”。

‘玖’ mac 自带python怎么升级

先去python的官网下载最新的python,并安装好。
现在要删除mac自带的python,如下:
sudo rm -R /System/Library/Frameworks/Python.framework/Versions/2.7
把第一步里安装好的Python目录移到原本系统所持有的目录位置。
sudo mv /Library/Frameworks/Python.framework/Versions/3.3
/System/Library/Frameworks/Python.framework/Versions
第三步,修改文件所属的Group
设置Group为wheel,原来系统自带的就是这样的。

‘拾’ python-devel怎么升级

这要看你的源是怎么打包的不过如果你安装的Python包叫做python27的话,他通常叫做python27-devel。
如果是编译安装的话不需要安装-devel包。

wget Python-2.7.6.tar.xz
tar xJf Python-2.7.6.tar.xzcd Python-2.7.6
./configure --enable-shared --prefix=/usr/local/python2.7
make
make installecho /usr/local/python2.7/lib > /etc/ld.so.conf.d/python2.7.conf
ldconfig
restorecon -RF /

另外强烈不建议自己构建RPM包,因为百害而无一利,可以试试IUS源。

热点内容
饭团文件夹 发布:2024-05-20 10:56:18 浏览:574
win10系统重置密码是多少 发布:2024-05-20 10:47:51 浏览:992
java加包 发布:2024-05-20 10:39:12 浏览:713
网吧里的电影怎么传服务器 发布:2024-05-20 10:31:12 浏览:809
新年解压糖 发布:2024-05-20 09:50:55 浏览:55
以太坊价值在哪里存储 发布:2024-05-20 09:46:34 浏览:642
cgipython配置 发布:2024-05-20 09:29:06 浏览:865
在我的世界服务器中隐身 发布:2024-05-20 09:07:46 浏览:972
加西贝拉压缩机好吗 发布:2024-05-20 08:58:56 浏览:757
eve脚本航 发布:2024-05-20 08:56:59 浏览:591