esoergel / peacecorps

Random Hacks of Kindness - Boston
2 stars 7 forks source link

Taggit installation problems #37

Closed beechnut closed 11 years ago

beechnut commented 11 years ago

I'm on OS X 10.7 Lion, and when I run python manage.py migrate after sourcing into virtualenv and running pip install -r requirements.txt, I have trouble with taggit:

django.core.exceptions.ImproperlyConfigured: ImportError taggit: No module named taggit

Thad and I had problems with this at the hackathon, but we got around them by removing taggit from the dependencies since we didn't really need them at the time.

Does anyone know a solution to this?

File "manage.py", line 10, in <module>
    execute_from_command_line(sys.argv)
  File "/Users/matt/Documents/repos/peacecorps/environment/lib/python2.7/site-packages/django/core/management/__init__.py", line 453, in execute_from_command_line
    utility.execute()
  File "/Users/matt/Documents/repos/peacecorps/environment/lib/python2.7/site-packages/django/core/management/__init__.py", line 392, in execute
    self.fetch_command(subcommand).run_from_argv(self.argv)
  File "/Users/matt/Documents/repos/peacecorps/environment/lib/python2.7/site-packages/django/core/management/__init__.py", line 272, in fetch_command
    klass = load_command_class(app_name, subcommand)
  File "/Users/matt/Documents/repos/peacecorps/environment/lib/python2.7/site-packages/django/core/management/__init__.py", line 77, in load_command_class
    module = import_module('%s.management.commands.%s' % (app_name, name))
  File "/Users/matt/Documents/repos/peacecorps/environment/lib/python2.7/site-packages/django/utils/importlib.py", line 35, in import_module
    __import__(name)
  File "/Users/matt/Documents/repos/peacecorps/environment/lib/python2.7/site-packages/south/management/commands/__init__.py", line 10, in <module>
    import django.template.loaders.app_directories
  File "/Users/matt/Documents/repos/peacecorps/environment/lib/python2.7/site-packages/django/template/loaders/app_directories.py", line 25, in <module>
    raise ImproperlyConfigured('ImportError %s: %s' % (app, e.args[0]))
django.core.exceptions.ImproperlyConfigured: ImportError taggit: No module named taggit
esoergel commented 11 years ago

Is taggit installed? If you run pip freeze, it'll show the python libraries installed (it should be called django-taggit). Also try pip install django-taggit. You'll also need to syncdb (python manage.py syncdb) before migrating, particularly if you're creating a new database.

beechnut commented 11 years ago

Okay, everything installed and migrated properly. Here's what I did:

virtualenv --no-site-packages environment
source environment/bin/activate
pip install django-taggit # explicitly, even though it's in requirements.txt
pip install -r requirements.txt
python manage.py syncdb
python manage.py migrate
beechnut commented 11 years ago

Then I ran into a braces error, so I ran:

curl -O http://python-distribute.org/distribute_setup.py
python distribute_setup.py
pip install django-braces

and now we're all good.

esoergel commented 11 years ago

I think I've seen that same error, before. Did you get a message that says "No module named pkg_resources" or something? I've followed the instructions on this stack overflow threadhttp://stackoverflow.com/questions/7446187/no-module-named-pkg-resourcesa few times. Not sure what causes it.

On Mon, Jun 17, 2013 at 9:18 PM, beechnut notifications@github.com wrote:

Then I ran into a braces error, so I ran:

curl -O http://python-distribute.org/distribute_setup.py python distribute_setup.py pip install django-braces

and now we're all good.

— Reply to this email directly or view it on GitHubhttps://github.com/esoergel/peacecorps/issues/37#issuecomment-19585537 .

esoergel commented 11 years ago

Oh, nm, I just read the second answer on that thread:

It also happened to me. I think the problem will happen if the requirements.txt contains a "distribute" entry while the virtualenv uses setuptools. Pip will try to patch setuptools to make room for distribute, but unfortunately it will fail half way.

mkvirtualenv yourenv --distribute

should do the trick to prep venv to use distribute rather than setuptools.

-Ethan

On Mon, Jun 17, 2013 at 10:02 PM, Ethan Soergel esoergel@gmail.com wrote:

I think I've seen that same error, before. Did you get a message that says "No module named pkg_resources" or something? I've followed the instructions on this stack overflow threadhttp://stackoverflow.com/questions/7446187/no-module-named-pkg-resourcesa few times. Not sure what causes it.

On Mon, Jun 17, 2013 at 9:18 PM, beechnut notifications@github.comwrote:

Then I ran into a braces error, so I ran:

curl -O http://python-distribute.org/distribute_setup.py python distribute_setup.py pip install django-braces

and now we're all good.

— Reply to this email directly or view it on GitHubhttps://github.com/esoergel/peacecorps/issues/37#issuecomment-19585537 .