【发布时间】:2020-03-24 07:30:47
【问题描述】:
我是 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 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
我该如何解决?为什么会这样?
【问题讨论】:
-
查看stackoverflow.com/a/42328420/7954504,特别是
libssl-dev,然后重新制作 -
嗨,布拉德!不幸的是,它没有奏效。我已经安装了 libssl-dev。尝试安装您在帖子中建议的所有软件包,但仍然无法正常工作
-
你为什么
apt installpip,你从源代码编译的python安装不是已经自带pip了吗? -
它已经在我使用的脚本中了。但即使没有它,也没有什么不同。每当我尝试使用 pip3 时,都会出现 pip3 的这个问题。比如安装pandas或者其他包
标签: python-3.x ssl pip