jane5ky's profile - activity
2015-10-12 16:58:34 -0500 | received badge | Notable Question (source) |
2014-09-22 14:29:41 -0500 | received badge | Famous Question (source) |
2014-09-22 14:29:41 -0500 | received badge | Popular Question (source) |
2011-07-28 12:05:55 -0500 | marked best answer | ImportError: cannot import name content Hi there, I could not reproduce your error, but I would like to test on your versions of django and the same database, and same version of the python db adapter. Most likely it is a missing dependency problem and not circular import. If you like to debug the import problem - add print statements before and after the suspect import. Once you find a place like that - go one level deeper and continue. I will add a requirements file soon, to ease the installation of askbot with pip in the cases like yours. Someone already pointed out that it is not easy to debug dependency issues in askbot, we'll need to add more explicit checks for that. |
2011-07-28 12:05:55 -0500 | received badge | Scholar ( source ) |
2011-07-28 12:05:30 -0500 | commented answer | ImportError: cannot import name content Thanks Evgeny, you were right. The missing dependency was "unidecode". Looks like python indeed is good at swallowing dependencies - or perhaps there is try-except somewhere hiding the real issue. Anyway, you rock! - keep up the good work :) |
2011-07-28 11:34:43 -0500 | commented answer | ImportError: cannot import name content ... Looks like slugify import triggers second round of imports towards model. In case of missing dependencies, I would expect to get ImportError: No module named <missing import>, looks like this isn't such case however. |
2011-07-28 11:33:20 -0500 | commented answer | ImportError: cannot import name content Hi and thanks for a fast response. Python version = 2.7.1, environment = windows 7. As database I try to use sqlite, which I'm sure will bring additional problems. However I'm not sure why selection of database would introduce such error; IIUC, syncdb is in a phase trying to go through the modules to create SQL for the database to use. I pinpointed the problem with printing method as you suggested, result can be seen here: http://pastebin.com/1Nf2sTBX. I inserted prints before and after relevant modules and relevant imports ... |
2011-07-28 09:10:08 -0500 | received badge | Student (source) |
2011-07-28 09:06:46 -0500 | asked a question | ImportError: cannot import name content I try to develop a site with askbot as one of its applications. Instead of installing askbot with e.g. easy_install, I grabbed the latest sources from git, and started to build around that. I worked my way across all the required dependencies, installing them one by one. The Django project using askbot is now able to find askbot modules and related dependencies without a problem. Now, when I try to run syncdb and continue from there, I get the following error: While inspecting the askbot sources, I think I found a circular dependency between models/__init__.py (from askbot.models.question import Question, QuestionRevision) and models/question.py (from askbot.models import content). I guess the second import comes basically back to module __init__ to see what is exported, and __init__ is still not initialized. It might be that this behavior is due to my python version (2.7), but anyway it would be nice to get expert's opinion what is happening here. From generic refactoring point of view, I think it's good to avoid circular dependencies. Perhaps you have already some plans to fix this problem? This assuming that my assumption here is the correct one :) |