Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ImportError: cannot import name 'DEFAULT_CIPHERS' from 'urllib3.util.ssl_' #1499

Closed
2 tasks done
tonal opened this issue May 5, 2023 · 3 comments
Closed
2 tasks done
Labels
bug Something isn't working new Needs triage. Comments are welcome!

Comments

@tonal
Copy link

tonal commented May 5, 2023

Checklist

  • I've searched for similar issues.
  • I'm using the latest version of HTTPie.

Minimal reproduction code and steps

  1. mkdir httpie && cd httpie
  2. pyenv virtualenv 3.11.3 httpie
  3. pip install httpie
  4. 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

@tonal tonal added bug Something isn't working new Needs triage. Comments are welcome! labels May 5, 2023
@strokirk
Copy link

strokirk commented May 5, 2023

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
Copy link

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
Copy link
Member

jkbrzt commented May 19, 2023

Fixed in v3.2.2. Thanks, everyone!

@jkbrzt jkbrzt closed this as completed May 19, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working new Needs triage. Comments are welcome!
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants