skip to Main Content

I want to try import pymongo via JupyterLab but i have received an error message

and tried uninstall pymongo, httpx, httpcore and again install them but not work.

how can i solve this problem, please help me.

Thank you for interest.

let me show you that message:

import yfinance as yf
from pymongo import MongoClient

---------------------------------------------------------------------------
.......
.....
....

~anaconda3libsite-packagesdnsquery.py in <module>
     65     import httpx
     66 
---> 67     _CoreNetworkBackend = httpcore.NetworkBackend
     68     _CoreSyncStream = httpcore._backends.sync.SyncStream
     69 
AttributeError: module 'httpcore' has no attribute 'NetworkBackend'

2

Answers


  1. I also ran into this problem yesterday with a container that was working prior to 7/26/23.
    My issue seemed to be stemming from FastAPI at first glance but what I found is it actually came from a dns support package called dnspython.

    Seems to me whatever they updated on 7/26/23 is the source of this issue.
    For me forcing an earlier version of dnspython solved my issue.

    Login or Signup to reply.
  2. As @Philip Rago mentioned, the error is with the dnspython package.

    Try executing the following command-

    pip install dnspython==2.3.0
    

    This installs the version of dnspython prior to the latest one that is causing the error.

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search