VirtualBox CentOS 7安裝Python3
----------歡迎加入學習交流QQ群:657341423
CentOS7預設安裝了python2.7.5,當需要使用python3的時候,可以手動下載Python原始碼後編譯安裝。
1.安裝python3可能使用的依賴
yum install openssl-devel bzip2-devel expat-devel gdbm-devel readline-devel sqlite*-devel
2.下載python
切換到根目錄
cd /
下載之前需要安裝wget
yum -y install wget
此處以3.5版本為例,如需安裝其他Python版本,可在通過Python官網查詢相關版本連結
wget "https://www.python.org/ftp/python/3.6.3/Python-3.6.3.tgz"
3.解壓下載好的壓縮包
tar -zxvf Python-3.6.3.tgz
發現多出資料夾Python-3.6.3
根目錄切換到Python-3.6.3資料夾
cd Python-3.6.3
編譯
sudo ./configure
make
make install
如果執行sudo ./configure --enable-optimizations
提示:no acceptable C compiler found in $PATH
因為沒有GCC編譯器環境,所以先安裝gcc再執行上述語句
yum -y install gcc
完成編譯之後,輸入python3,即可進入python互動模式,上述安裝方式是將python3安裝在根目錄,如果想改變路徑,在解壓得出的資料夾轉移到其他路徑,命令如下:
把python移到/usr/local下面
mv Python-3.6.3 /usr/local
相關文章
- VirtualBox安裝Centos7CentOS
- vagrant + virtualBox 安裝centos7CentOS
- Oracle VM VirtualBox安裝centos7OracleCentOS
- virtualbox安裝centos7,network is unreachableCentOS
- Virtualbox 安裝centos7虛擬機器CentOS虛擬機
- CentOS7快速安裝python3CentOSPython
- CentOS 7下編譯安裝Python3CentOS編譯Python
- centos7編譯安裝python3CentOS編譯Python
- CentOS 7 如何編碼安裝Python3?CentOSPython
- centOS安裝python3CentOSPython
- CentOS 安裝Python3CentOSPython
- 為CentOS安裝python3CentOSPython
- 秒搞VirtualBox 、CentOS 的安裝過程CentOS
- centos7 安裝Python3及配置環境變數CentOSPython變數
- How to Install VirtualBox 5.2 on CentOS 7CentOS
- Centos7-VMware+Centos7安裝配置CentOS
- 【CentOS】CentOS7安裝PostgreSQLCentOSSQL
- Centos 7 Docker 安裝CentOSDocker
- CentOS 7 安裝redisCentOSRedis
- CentOS 7安裝ElasticsearchCentOSElasticsearch
- Centos 7安裝iscsiCentOS
- centos 7 安裝 rabbitMqCentOSMQ
- CentOS7安裝rabbitmqCentOSMQ
- CentOS 7安裝RedisCentOSRedis
- CentOS 7 安裝 lnmpCentOSLNMP
- Centos 7安裝FTPCentOSFTP
- Centos 7 安裝JDKCentOSJDK
- Centos 7 安裝NginxCentOSNginx
- CentOS 7 - 安裝NginxCentOSNginx
- CentOS 7安裝MySQLCentOSMySql
- VirtualBox安裝
- 如何在 CentOS 8 / RHEL 8 上安裝 VirtualBox 6.0CentOS
- CentOS探索之路3—安裝python3CentOSPython
- CentOS7安裝php、安裝MySqlCentOSPHPMySql
- Centos7安裝安裝部署dockerCentOSDocker
- rhel7安裝python3Python
- centos7安裝nginxCentOSNginx
- Centos7 安裝 NginxCentOSNginx
- centos7 安裝 rcloneCentOS