Python 3.x python 3.6.10未配置pip3 TLS/SSL
我是Python的乞丐,有些问题正在发生。这是一个用于安装python 3.6.10的脚本:Python 3.x python 3.6.10未配置pip3 TLS/SSL,python-3.x,ssl,pip,Python 3.x,Ssl,Pip,我是Python的乞丐,有些问题正在发生。这是一个用于安装python 3.6.10的脚本: sudo apt-get update sudo apt-get upgrade sudo apt-get install zlib1g-dev apt-get install -y libxml2-dev libxslt1-dev libffi-dev libssl-dev apt-get install -y libgdal-dev apt-get install -y tor apt-get i
sudo apt-get update
sudo apt-get upgrade
sudo apt-get install zlib1g-dev
apt-get install -y libxml2-dev libxslt1-dev libffi-dev libssl-dev
apt-get install -y libgdal-dev
apt-get install -y tor
apt-get install -y unzip
apt-get install -y s3cmd
apt-get install -y libfreetype6-dev
apt-get install -y pkg-config
apt-get install -y qt5-default
apt-get install -y libqt5webkit5-dev
apt-get install -y texinfo
apt-get install -qy firefox xvfb
apt-get install -y tree
apt-get install -y htop
apt-get install -y chromium-browser
sudo apt-get install build-essential checkinstall
sudo apt-get install libreadline-gplv2-dev libncursesw5-dev libsqlite3-dev tk-dev libgdbm-dev libc6-dev libbz2-dev
cd /opt
sudo wget https://www.python.org/ftp/python/3.6.10/Python-3.6.10.tgz
sudo tar -xvf Python-3.6.10.tgz
cd Python-3.6.10
sudo ./configure --with-ssl
sudo make
sudo make install
sudo apt-get install -y build-essential python-pip python3-pip git
sudo -H pip install --upgrade pip
sudo -H pip3 install --upgrade pip
除了pip3之外,安装似乎工作正常。错误正在发生,我没有找到解决方法
pip is configured with locations that require TLS/SSL, however the ssl module in Python is not available.
Retrying (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/pip/
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/pip/
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/pip/
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/pip/
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/pip/
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
Requirement already up-to-date: pip in /usr/local/lib/python3.6/site-packages (18.1)
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
我怎样才能修好它?为什么会这样呢?首先:Python的构建应该允许您使用
python3-mpip
作为pip
命令。-m
标志用于确保将使用的pip
与正确的Python解释器相关联。因此,python-pip-python3-pip
安装应该是不必要的*
第二:关于SSL选项,您可能需要python openssl
。具有讽刺意味的是,当我试图在packages.ubuntu.com上搜索时,我遇到了一个服务器端错误,但它显示在libssl-dev
旁边
是一个Dockerfile,演示了上述两点:
docker image build -f Dockerfile.60814903 -t so60814903:1 .
docker container run -it --rm so60814903:1
在这个shell中,您应该看到有可用的python3-mpip
最后一个技巧,考虑一个解决方案,它将帮助您管理多个Python版本。就是这样一个工具,还有其他的工具
具体来说,
/configure
默认情况下将使用--with EnsureIP='upgrade'
。是一个使用--with EnsureIP=no
并单独安装pip的安装示例。请参阅,特别是libssl dev
,并重新制作Hi,Brad!不幸的是,它没有起作用。我已经安装了libssl-dev。尝试安装您在帖子中建议的所有软件包,但仍然不起作用。为什么apt安装pip,您从源代码处编译的python的安装是否还没有附带pip?它已经在我使用的脚本中了。但即使没有它,也没有什么不同。每当我尝试使用pip3时,pip3就会出现这个问题。例如,安装pandas或其他软件包