Linux下安裝Python3.5.2、Django、paramiko
阿新 • • 發佈:2018-09-29
roo help 更新 pip3 sim egg pan man inf
1,安裝依賴文件:
yum install zlib zlib-devel openssl openssl-devel
2,下載Python3.5.2:
安全連接時,要增加:--no-check-certificate
wget --no-check-certificate https://www.python.org/ftp/python/3.5.2/Python-3.5.2.tgz
3,解壓、安裝
[root@Server tmp]#tar -xf Python-3.5.2.tgz
[root@Server tmp]#cd Python-3.5.2.tgz
[root@Server tmp]#./configure --prefix=/usr/python3
[root@Server tmp]#make && make install
4,配置環境變量
root@Server bin]# cd /usr/python3/bin
[root@Server bin]# ./python3
Python 3.5.2 (default, Sep 16 2018, 01:55:10)
[GCC 4.4.7 20120313 (Red Hat 4.4.7-23)] on linux
Type "help", "copyright", "credits" or "license" for more information.
[root@Server bin]#PATH=$PATH:/usr/python3/bin/
[root@Server bin]# echo $PATH
/usr/lib64/qt-3.3/bin:/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:/root/bin:/usr/python3/bin/
5,執行Python3
root@Server bin]# python3
Python 3.5.2 (default, Sep 16 2018, 01:55:10)
[GCC 4.4.7 20120313 (Red Hat 4.4.7-23)] on linux
Type "help", "copyright", "credits" or "license" for more information.
6,安裝Django和paramiko
pip3 install -i http://pypi.douban.com/simple/ paramiko --trusted-host pypi.douban.com
pip3 install -i http://pypi.douban.com/simple/ django --trusted-host pypi.douban.com
########如果出現錯誤 Command "python setup.py egg_info" failed with error code 1 in /tmp/pip-build-z18k0zhw/pynacl/
###更新pip的版本
[root@Server tmp]# python3 -m pip install -i http://pypi.douban.com/simple/ --upgrade pip --trusted-host pypi.douban.com
Linux下安裝Python3.5.2、Django、paramiko