0

whenever I import the module "httpx", for example in this code:

import httpx

input()

I get this error:

module 'httpcore' has no attribute 'TimeoutException'
  line 1, in <module>
    import httpx
Takaso2
  • 47
  • 3
  • 8

3 Answers3

1

What version of pip are you using ? Try updating pip and reinstalling the package Or you can try installing the pre 10 release using $ pip install httpx --pre as stated in the httpx docs https://www.python-httpx.org/

  • I installed httpcore[http2] and it worked – Takaso2 Sep 26 '21 at 12:37
  • Please phrase this as an explained conditional answer, in order to avoid the impression of asking a clarification question instead of answering (for which a comment should be used instead of an answer, compare https://meta.stackexchange.com/questions/214173/why-do-i-need-50-reputation-to-comment-what-can-i-do-instead ). For example like "If your problem is ... then the solution is to .... because .... ." – Yunnosch Oct 03 '21 at 14:35
1

You might need to stick with an older version of httpx for now, try version 19

pip install httpx==0.19.0
buddemat
  • 4,552
  • 14
  • 29
  • 49
Tor
  • 36
  • 2
0

Ok, I finally solved the error after 1 month, all you got to do is:

pip uninstall httpcore

then

pip install httpcore[http2]
Takaso2
  • 47
  • 3
  • 8