linux 上安裝部署python

來源:互聯網
上載者:User

標籤:檔案   env   exit   tin   color   code   bin   centos6   AC   

一般在linux中使用python 需要安裝pyenv 進資料列版本設定 因為linux6.9內建的Python是2.6的 同時很多命令都是基於2.6開發的 所以系統內容不能改 我們要開發 只能用pyenv進資料列版本設定 建立一個檔案夾做虛擬環境 安裝Python3.5.5 後期這個虛擬環境 開發就是使用python3.5.5

第一步 安裝git  (pyenv在git上)

yum install git -y 

第二部在git上拽取pyenv

 

[[email protected] ~]$ git clone https://github.com/yyuu/pyenv.git ~/.pyenvInitialized empty Git repository in /home/python/.pyenv/.git/remote: Counting objects: 16351, done.remote: Compressing objects: 100% (72/72), done.remote: Total 16351 (delta 60), reused 90 (delta 46), pack-reused 16226Receiving objects: 100% (16351/16351), 3.15 MiB | 247 KiB/s, done.Resolving deltas: 100% (11102/11102), done.[[email protected] ~]$ echo ‘export PYENV_ROOT="$HOME/.pyenv"‘ >> ~/.bash_profile      [[email protected] ~]$ echo ‘export PATH="$PYENV_ROOT/bin:$PATH"‘ >> ~/.bash_profile[[email protected] ~]$ echo ‘eval "$(pyenv init -)"‘ >> ~/.bash_profile[[email protected] ~]$ exit          #需要退出重新登入[[email protected] ~]# su - python

第三步安裝Python 現在pyenv install --help 查看可安裝的Python版本

python install 3.5.5 進行安裝

 

linux 上安裝部署python

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.