Python 官方文档:入门教程 => 点击学习
python3 pip Install Error: No matching distribution found for 安装openssl wget https://www.openssl.or
python3 pip Install Error: No matching distribution found for
安装openssl
wget https://www.openssl.org/source/openssl-1.1.1a.tar.gztar -zxvf openssl-1.1.1a.tar.gzcd openssl-1.1.1a./config --prefix=/usr/local/openssl-1.1.1 --openssldir=/usr/local/openssl-1.1.1 make && make install# 方法一,声明临时变量,怕影响线上服务推荐使用该方法# 包括后续引用库文件都要提前声明export LD_LIBRARY_PATH=/usr/local/openssl-1.1.1/lib:$LD_LIBRARY_PATH# 方法二,永久声明变量echo "/usr/local/openssl-1.1.1/lib" >> /etc/ld.so.conf.d/openssl-1.1.1-x86_64.confldconfig
安装python3
--下载Pythonwget https://www.python.org/ftp/python/3.7.11/Python-3.7.11.tar.xz--解压缩、编译和安装tar xvf Python-3.7.11.tar.xzcd Python-3.7.11./configure --prefix=/usr/local/python-3.7.11 --enable-optimizations --with-openssl=/usr/local/openssl-1.1.1make && make install--做个软连接到当前用户的bin目录ln -s /usr/local/python-3.7.11 /usr/local/python3ln -s /usr/local/python-3.7.11/bin/python3.7 /usr/bin/python3ln -s /usr/local/python-3.7.11/bin/pip3 /usr/bin/pip3
可能会报错:
zipimport.ZipImportError: can’t decompress data
解决方法:
1、打开终端,输入一下命令安装zlib相关依赖包:yum -y install zlib*2、进入 python安装包,修改Module路径的setup文件:(1)Modules/Setup.dist (或者 Modules/Setup) 文件vim Modules/Setup.dist (2)找到一下一行代码,去掉注释:#zlib zlibmodule.c -I$(prefix)/include -L$(exec_prefix)/lib -lz去掉注释 zlib zlibmodule.c -I$(prefix)/include -L$(exec_prefix)/lib -lz(3)进入python的安装包路径下执行: make && make install
来源地址:https://blog.csdn.net/qq_38818972/article/details/129285353
--结束END--
本文标题: python3安装及pip3 报ERROR: No matching distribution found for
本文链接: https://www.lsjlt.com/news/433042.html(转载时请注明来源链接)
有问题或投稿请发送至: 邮箱/279061341@qq.com QQ/279061341
下载Word文档到电脑,方便收藏和打印~
2024-03-01
2024-03-01
2024-03-01
2024-02-29
2024-02-29
2024-02-29
2024-02-29
2024-02-29
2024-02-29
2024-02-29
回答
回答
回答
回答
回答
回答
回答
回答
回答
回答
0