Centos7中安装python3.7、pip3以及pipenv(亲测有效)
生活随笔
收集整理的这篇文章主要介绍了
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-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)最后创建软链接
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依赖出现问题,导致pip未够正常使用,需要更新依赖!
解决方案:
戳这里 谢谢作者分享!
3.使用pip3安装pipenv时出现ReadTimeoutError
安装指令:
pip3 install pipenv错误信息(此时简略错误信息):
ReadTimeoutError解决方案:
使用以下指令:
4.查看pipenv版本报错
[root@instance-6lf3j8lp Python-3.7.0]# pipenv --version -bash: pipenv: command not found原因:未建立软链接
解决方案:
总结
以上是生活随笔为你收集整理的Centos7中安装python3.7、pip3以及pipenv(亲测有效)的全部内容,希望文章能够帮你解决所遇到的问题。
- 上一篇: 缺氧游戏计算机,缺氧PC最低什么配置一览
- 下一篇: python中列表如何比较大小_如何比较