當前位置:首頁 » 編程語言 » 升級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-17 07:39:44 瀏覽:475
安卓訪客模式app哪個好 發布:2024-05-17 07:38:25 瀏覽:165
html資料庫table 發布:2024-05-17 07:27:56 瀏覽:993
linux加密程序包 發布:2024-05-17 07:16:18 瀏覽:472
郵件伺服器軟體快速搭建 發布:2024-05-17 07:03:53 瀏覽:281
ipad開機密碼怎麼找回 發布:2024-05-17 07:03:08 瀏覽:651
查詢賬單初始密碼是多少 發布:2024-05-17 06:58:45 瀏覽:650
反編譯封掛 發布:2024-05-17 06:17:42 瀏覽:820
台電怎麼從電腦轉至安卓 發布:2024-05-17 06:07:23 瀏覽:436
我的世界國際版伺服器里如何開掛 發布:2024-05-17 06:06:05 瀏覽:873