SSL module is not available
Ошибка | |
Решение | |
Похожие статьи |
Если вы пытаетесь использовать pip и получаете ошибку
WARNING: 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
Значит у вас не установлены библиотеки для работы с ssl.
Как вариант решения - предлагаю установить их и потом заново скачать Python и установить с помощью configure make install
В Ubuntu , Debian и других .deb
sudo apt-get install libreadline-gplv2-dev libncursesw5-dev libssl-dev libsqlite3-dev tk-dev libgdbm-dev libc6-dev libbz2-dev
В CentOS , RedHat , Rocky и других .rpm
sudo yum install -y zlib-devel bzip2-devel openssl-devel ncurses-devel sqlite-devel zlib* libffi-devel readline-devel tk-devel
Следующая команда подойдёт для всех Linux
wget https://www.python.org/ftp/python/3.9.1/Python-3.9.1.tgz ; tar xvzf Python-3.9.1.tgz ; cd Python-3.9.1 ; ./configure ; sudo make install
Если всё хорошо вы сможете пользоваться pip.
Если не помогло - попробуйте сперва удалить старый Python и только потом ставить новый
Подробнее об установке Python в Linux читайте здесь
Полное сообщение о похожей ошибке при попытке установить flake8
python -m pip install flake8
Defaulting to user installation because normal site-packages is not writeable WARNING: pip is configured with locations that require TLS/SSL, however the ssl module in Python is not available. WARNING: 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/flake8/ WARNING: 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/flake8/ WARNING: 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/flake8/ WARNING: 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/flake8/ WARNING: 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/flake8/ Could not fetch URL https://pypi.org/simple/flake8/: There was a problem confirming the ssl certificate: HTTPSConnectionPool(host='pypi.org', port=443): Max retries exceeded with url: /simple/flake8/ (Caused by SSLError("Can't connect to HTTPS URL because the SSL module is not available.")) - skipping ERROR: Could not find a version that satisfies the requirement flake8 (from versions: none) ERROR: No matching distribution found for flake8 WARNING: 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 WARNING: There was an error checking the latest version of pip.
Проверить установлен ли модуль ssl можно следующим образом
python
Python 3.11.3 (main, Apr 27 2023, 13:20:10) [GCC 11.3.0] on linux Type "help", "copyright", "credits" or "license" for more information. >>> help('modules') Please wait a moment while I gather a list of all available modules... /usr/local/lib/python3.11/site-packages/_distutils_hack/__init__.py:33: UserWarning: Setuptools is replacing distutils. warnings.warn("Setuptools is replacing distutils.") __future__ _warnings graphlib secrets … _sha1 difflib platform turtledemo _sha256 dir_ex plistlib types _sha3 dis poplib typing _sha512 distutils posix unicodedata _signal doctest posixpath unittest _sitebuiltins email pprint urllib _socket encodings profile uu _sre ensurepip pstats uuid _stat enum pty venv _statistics enumerate_demo pwd warnings _string errno py_compile wave _strptime faulthandler pyclbr weakref _struct fcntl pydoc webbrowser _symtable filecmp pydoc_data wsgiref _sysconfigdata__linux_x86_64-linux-gnu fileinput pyexpat xdrlib _testbuffer fnmatch queue xml … _typing glob sched Enter any module name to get more help. Or, type "modules spam" to search for modules whose name or summary contain the string "spam".