ImportError: cannot import name 'DEFAULT_CIPHERS' from 'urllib3.util.ssl_'
tonal opened this issue · 3 comments
tonal commented
Checklist
- I've searched for similar issues.
- I'm using the latest version of HTTPie.
Minimal reproduction code and steps
- mkdir httpie && cd httpie
- pyenv virtualenv 3.11.3 httpie
- pip install httpie
- http --version
Current result
Traceback (most recent call last):
File "/home/tonal/.pyenv/versions/httpie/bin/http", line 8, in <module>
sys.exit(main())
^^^^^^
File "/home/tonal/.pyenv/versions/3.11.3/envs/httpie/lib/python3.11/site-packages/httpie/__main__.py", line 8, in main
from httpie.core import main
File "/home/tonal/.pyenv/versions/3.11.3/envs/httpie/lib/python3.11/site-packages/httpie/core.py", line 15, in <module>
from .client import collect_messages
File "/home/tonal/.pyenv/versions/3.11.3/envs/httpie/lib/python3.11/site-packages/httpie/client.py", line 22, in <module>
from .ssl_ import AVAILABLE_SSL_VERSION_ARG_MAPPING, HTTPieCertificate, HTTPieHTTPSAdapter
File "/home/tonal/.pyenv/versions/3.11.3/envs/httpie/lib/python3.11/site-packages/httpie/ssl_.py", line 6, in <module>
from urllib3.util.ssl_ import (
ImportError: cannot import name 'DEFAULT_CIPHERS' from 'urllib3.util.ssl_' (/home/tonal/.pyenv/versions/3.11.3/envs/httpie/lib/python3.11/site-packages/urllib3/util/ssl_.py)
Expected result
current version of httpie
Debug output
Please re-run the command with --debug
, then copy the entire command & output and paste both below:
$ http --debug --version
Traceback (most recent call last):
File "/home/tonal/.pyenv/versions/httpie/bin/http", line 8, in <module>
sys.exit(main())
^^^^^^
File "/home/tonal/.pyenv/versions/3.11.3/envs/httpie/lib/python3.11/site-packages/httpie/__main__.py", line 8, in main
from httpie.core import main
File "/home/tonal/.pyenv/versions/3.11.3/envs/httpie/lib/python3.11/site-packages/httpie/core.py", line 15, in <module>
from .client import collect_messages
File "/home/tonal/.pyenv/versions/3.11.3/envs/httpie/lib/python3.11/site-packages/httpie/client.py", line 22, in <module>
from .ssl_ import AVAILABLE_SSL_VERSION_ARG_MAPPING, HTTPieCertificate, HTTPieHTTPSAdapter
File "/home/tonal/.pyenv/versions/3.11.3/envs/httpie/lib/python3.11/site-packages/httpie/ssl_.py", line 6, in <module>
from urllib3.util.ssl_ import (
ImportError: cannot import name 'DEFAULT_CIPHERS' from 'urllib3.util.ssl_' (/home/tonal/.pyenv/versions/3.11.3/envs/httpie/lib/python3.11/site-packages/urllib3/util/ssl_.py)
Additional information, screenshots, or code examples
…
strokirk commented
DEFAULT_CIPHERS
is removed from urllib3
2.0.0: https://github.com/urllib3/urllib3/blob/main/CHANGES.rst#200-2023-04-26
As a workaround, it's possible to downgrade urllib3 manually:
pipx runpip httpie install -U 'urllib3<2'
lorenzogrv commented
I'm facing same issue. Downgrading to latest urllib3 on 1.x range worked around
pip install --no-cache-dir urllib3==1.26.15
jkbrzt commented
Fixed in v3.2.2. Thanks, everyone!