Uploaded image for project: 'Motor'
  1. Motor
  2. MOTOR-1371

PyMongo ImportError when using motor

    • Type: Icon: Bug Bug
    • Resolution: Duplicate
    • Priority: Icon: Minor - P4 Minor - P4
    • None
    • Affects Version/s: 3.4
    • Component/s: None
    • Python Drivers

      Using motor==3.4.0 in my project, pymongo not installed directly in environment. Since pymongo update ~7 hours ago to 4.9, getting the following trace:

       

      ```
      • › ImportError: cannot import name '. _QUERY_OPTIONS' from 'pymongo.cursor' (/REDACTED/lib/python3.11/site-packages/pymongo/cursor.py)
      File <command-redacted>, line 1
      ---› 1 from app.redacted import *
      File /REDACTED/lib/python3.11/site-packages/motor/core.py:30
      28 from pymongo.collection import Collection
      29 from pymongo.command_cursor import CommandCursor, RawBatchCommandCursor
      -> 30 from pymongo.cursor import _QUERY_OPTIONS, Cursor, RawBatchCursor
      31 from pymongo database import Database
      32 from pymongo.driver_info import DriverInfo
      ```

      Issue was resolved by forcing install of pymongo==4.8.0 after installing motor in environment.

            Assignee:
            shane.harvey@mongodb.com Shane Harvey
            Reporter:
            oshalev@healthequity.com Orr Shalev
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: