Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8046257
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T05:44:28+00:00 2026-06-05T05:44:28+00:00

I have currently django-mongodb-engine 0.4.0 version installed on my Mac OS X 10.6.8 and

  • 0

I have currently django-mongodb-engine 0.4.0 version installed on my Mac OS X 10.6.8 and weirdly encountered an interesting error while importing the ‘compiler’ module:

>> from django_mongodb_engine import compiler

and I got the following error:

ImportError Traceback (most recent call last)
/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/django_extensions/management/commands/shell_plus.pyc in <module>()
----> 1 from django_mongodb_engine import compiler

/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/django_mongodb_engine/compiler.pyc in <module>()
      15 from pymongo.errors import PyMongoError
      16 from pymongo import ASCENDING, DESCENDING
 ---> 17 from pymongo.objectid import ObjectId, InvalidId
      18 
      19 from djangotoolbox.db.basecompiler import NonrelQuery, NonrelCompiler, \

ImportError: No module named objectid

I installed the package via pip command and all the dependencies like pymongo, djangotoolbox have been installed along with it. The pip command I’d used is this:

>> sudo env ARCHFLAGS='-arch i386 -arch x86_64' pip install --upgrade  django-mongodb-engine

The current versions of the related packages are:

>> pip freeze | grep mongo
django-mongodb-engine==0.4.0
pymongo==2.2

I suspect the django_mongodb_engine package is broken because ObjectId is not imported inside pymongo anymore. Instead, it belongs to bson module.

What are your suggestions to fix this problem? Should I clone the django-mongodb-engine project and fix on github?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-05T05:44:29+00:00Added an answer on June 5, 2026 at 5:44 am

    I’ve ran into something similar, for me the problem was this line:

    from pymongo.objectid import ObjectId
    

    The call seems to work in versions of PyMongo < 2.2

    In pymongo 2.2 the call to import objectid is:

    from bson.objectid import ObjectId
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm currently using Django 1.0 on my Mac OS X 10.5.7 box. It's installed
I am currently using Django forms with the Google App Engine and I have
I'm currently on shared hosting plan with dreamhost and have installed Django as per
I currently have a django site, and it's kind of slow, so I want
I currently have a workable Django admin on the left mockup below but want
I currently have a DetailView for Django's built-in User . url( r'^users/(?P<pk>\d+)/$', DetailView.as_view( model
We currently have two EC2 servers running apache servers with django wsgi on freebsd.
Basically, I currently have login/ in urls.py redirect to the django.contrib.auth.views.login and that seems
Can you use contrib.auth.models.User or any of contrib.auth along with Django MongoDB Engine ?
I have django installed on my server with pymongo and mongoengine.My django project settings.py

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.