日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當前位置: 首頁 > 编程语言 > python >内容正文

python

Centos7中安装python3.7、pip3以及pipenv(亲测有效)

發布時間:2023/12/20 python 28 豆豆
生活随笔 收集整理的這篇文章主要介紹了 Centos7中安装python3.7、pip3以及pipenv(亲测有效) 小編覺得挺不錯的,現在分享給大家,幫大家做個參考.

文章目錄

  • 1.安裝python3.7以及pip3
  • 2.使用pip3安裝pipenv時pip報錯
  • 3.使用pip3安裝pipenv時出現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-devel

2)然后下載 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.tgz

3)編譯安裝:

cd Python-3.7.0 ./configure –prefix=/usr/local/python3 make && make install

4)最后創建軟鏈接

ln -s /usr/local/python3/bin/python3 /usr/bin/python3 ln -s /usr/local/python3/bin/pip3 /usr/bin/pip3

5)測試

python3 --version pip3 --version

升級pip3命令:

pip3 install –upgrade pip

2.使用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依賴出現問題,導致pip未夠正常使用,需要更新依賴!

解決方案:
戳這里 謝謝作者分享!

3.使用pip3安裝pipenv時出現ReadTimeoutError

安裝指令:

pip3 install pipenv

錯誤信息(此時簡略錯誤信息):

ReadTimeoutError

解決方案:
使用以下指令:

pip3 --default-timeout=100 install pipenv

4.查看pipenv版本報錯

[root@instance-6lf3j8lp Python-3.7.0]# pipenv --version -bash: pipenv: command not found

原因:未建立軟鏈接
解決方案:

ln -s /usr/local/python3/bin/pipenv /usr/bin/pipenv

總結

以上是生活随笔為你收集整理的Centos7中安装python3.7、pip3以及pipenv(亲测有效)的全部內容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網站內容還不錯,歡迎將生活随笔推薦給好友。