openssl을 다시 설치해도 pip is configured with locations that require TLS/SSL, however the ssl module in Python is not available.
2022-10-03 last update
5 minutes reading pyenv pip pyenv-virtualenv요약
pyenv(pyenv-virtualenv)를 사용하는 환경에서
pip install
pip is configured with locations that require TLS/SSL, however the ssl module in Python is not available.
라고 표시되어 설치를 할 수 없었다.
해결책으로
가면 고쳤다.
환경
OS: macOS Catalina
shell: fish
Python : pyenv-virtualenv의 Python3.7.3
pip: 19.0.3
문제
pip install requests
를 실행하면 다음 메시지가 표시되고 설치할 수 없습니다.$ pip install requests
pip is configured with locations that require TLS/SSL, however the ssl module in Python is not available.
Collecting requests
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/requests/
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/requests/
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/requests/
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/requests/
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/requests/
Could not fetch URL https://pypi.org/simple/requests/: There was a problem confirming the ssl certificate: HTTPSConnectionPool(host='pypi.org', port=443): Max retries exceeded with url: /simple/requests/ (Caused by SSLError("Can't connect to HTTPS URL because the SSL module is not available.")) - skipping
Could not find a version that satisfies the requirement requests (from versions: )
No matching distribution found for requests
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
openssl 재설치
pip 설치에서 pip is configured with locations that require TLS/SSL, however the ssl module in Python is not available. 를 참고하여
openssl
재설치brew unlink openssl
brew reinstall openssl
→ 고치지 않았다.
openssl 경로를 통과
openssl을 다시 설치할 때 다음 메시지가 표시되었으므로 아무 것도 생각하지 않습니다
~/.config/fish/config.fish
[email protected] is keg-only, which means it was not symlinked into /usr/local,
because macOS provides LibreSSL.
If you need to have [email protected] first in your PATH run:
echo 'set -g fish_user_paths "/usr/local/opt/[email protected]/bin" $fish_user_paths' >> ~/.config/fish/config.fish
For compilers to find [email protected] you may need to set:
set -gx LDFLAGS "-L/usr/local/opt/[email protected]/lib"
set -gx CPPFLAGS "-I/usr/local/opt/[email protected]/include"
For pkg-config to find [email protected] you may need to set:
set -gx PKG_CONFIG_PATH "/usr/local/opt/[email protected]/lib/pkgconfig"
→ 고치지 않았다.
파이썬 환경 변경
Requests (Caused by SSLError(“Can't connect to HTTPS URL because the SSL module is not available.”) Error in PyCharm requesting website를 읽으면,
brew upgrade python3
그리고 있었기 때문에 파이썬을 버전 업 해보십시오.
$ python -V # => Python 3.7.3
$ pyenv uninstall {pyenv-virtualenvの環境名}
$ pyenv install 3.7.4 # => このバージョンは初インストール
$ pyenv virtualenv 3.7.4 {pyenv-virtualenvの環境名}
→ 고쳤다.
고찰
분명히 설명할 수 있는 원인은 몰랐습니다만, pyenv가 환경 구축시에 그 근처 좋은 느낌으로 해 주기 때문에, 구축이 끝난 가상 환경을 보통의 환경과 같이 취급해도 잘 가지 않아. 라는 곳입니까?
기타
기사를 쓰기 위해 비슷한 사례를 조사하고 있으면, 꽤 기사가 있었습니다.
도하마 있을 때는 도착할 수 없는데, 해결한 뒤 기사를 쓰려고 하면 의외로 나온다. 이것 정말 힘들다.