Centos7中安装python3.7、pip3以及pipenv(亲测有效)
生活随笔
收集整理的這篇文章主要介紹了
Centos7中安装python3.7、pip3以及pipenv(亲测有效)
小編覺得挺不錯的,現(xiàn)在分享給大家,幫大家做個參考.
文章目錄
- 1.安裝python3.7以及pip3
- 2.使用pip3安裝pipenv時pip報錯
- 3.使用pip3安裝pipenv時出現(xiàn)ReadTimeoutError
- 4.查看pipenv版本報錯
1.安裝python3.7以及pip3
1)首先來安裝依賴
yum -y install gcc gcc-c++ yum -y groupinstall “Development tools” yum install openssl-devel bzip2-devel expat-devel gdbm-devel readline-devel sqlite-devel libffi-devel2)然后下載 Python-3.7.0 的源碼并解壓:
mkdir -p ~/src cd ~/src wget https://www.python.org/ftp/python/3.7.0/Python-3.7.0.tgz tar -zxvf Python-3.7.0.tgz3)編譯安裝:
cd Python-3.7.0 ./configure –prefix=/usr/local/python3 make && make install4)最后創(chuàng)建軟鏈接
ln -s /usr/local/python3/bin/python3 /usr/bin/python3 ln -s /usr/local/python3/bin/pip3 /usr/bin/pip35)測試
python3 --version pip3 --version升級pip3命令:
pip3 install –upgrade pip2.使用pip3安裝pipenv時pip報錯
安裝指令:
pip3 install pipenv錯誤信息:
pip is configured with locations that require TLS/SSL, however the ssl module in Python is not available. Collecting virtualenvRetrying (Retry(total=4, connect=None, read=None, redirect=None, status=None)) after connection broken by 'SSLError("Can't connect to HTTPS URL because the SSL module is not available.")': /simple/virtualenv/Retrying (Retry(total=3, connect=None, read=None, redirect=None, status=None)) after connection broken by 'SSLError("Can't connect to HTTPS URL because the SSL module is not available.")': /simple/virtualenv/Retrying (Retry(total=2, connect=None, read=None, redirect=None, status=None)) after connection broken by 'SSLError("Can't connect to HTTPS URL because the SSL module is not available.")': /simple/virtualenv/Retrying (Retry(total=1, connect=None, read=None, redirect=None, status=None)) after connection broken by 'SSLError("Can't connect to HTTPS URL because the SSL module is not available.")': /simple/virtualenv/Retrying (Retry(total=0, connect=None, read=None, redirect=None, status=None)) after connection broken by 'SSLError("Can't connect to HTTPS URL because the SSL module is not available.")': /simple/virtualenv/Could not fetch URL https://pypi.org/simple/virtualenv/: There was a problem confirming the ssl certificate: HTTPSConnectionPool(host='pypi.org', port=443): Max retries exceeded with url: /simple/virtualenv/ (Caused by SSLError("Can't connect to HTTPS URL because the SSL module is not available.")) - skippingCould not find a version that satisfies the requirement virtualenv (from versions: ) No matching distribution found for virtualenv pip is configured with locations that require TLS/SSL, however the ssl module in Python is not available. Could not fetch URL https://pypi.org/simple/pip/: There was a problem confirming the ssl certificate: HTTPSConnectionPool(host='pypi.org', port=443): Max retries exceeded with url: /simple/pip/ (Caused by SSLError("Can't connect to HTTPS URL because the SSL module is not available.")) - skipping原因:
yum 安裝的openssl 版本都比較低,即pip依賴出現(xiàn)問題,導(dǎo)致pip未夠正常使用,需要更新依賴!
解決方案:
戳這里 謝謝作者分享!
3.使用pip3安裝pipenv時出現(xiàn)ReadTimeoutError
安裝指令:
pip3 install pipenv錯誤信息(此時簡略錯誤信息):
ReadTimeoutError解決方案:
使用以下指令:
4.查看pipenv版本報錯
[root@instance-6lf3j8lp Python-3.7.0]# pipenv --version -bash: pipenv: command not found原因:未建立軟鏈接
解決方案:
總結(jié)
以上是生活随笔為你收集整理的Centos7中安装python3.7、pip3以及pipenv(亲测有效)的全部內(nèi)容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 缺氧游戏计算机,缺氧PC最低什么配置一览
- 下一篇: 学成在线--19.新增课程(数据字典)