[Answered ]-Tox and django_toolbar: ImportError

2👍

In the end, this was solved by upgrading tox. I’m not sure yet when this was fixed exactly, or what bug it was listed as, but using version 2.1.1 I do not get this error any longer.

👤Joost

0👍

File "/usr/local/lib/python3.4/site-packages/django/core/management/__init__.py", line 338, in execute_from_command_line

It looks to me like your Django is not installed inside of a virtualenv. If it were, it would point to /Users/$USER/path/to/virtualenv/lib/python3.4/site-packages/django/etc/etc/etc. Did you somehow set up tox to use the locally installed Django rather than the Django installed inside of the virtualenv?

0👍

I now also uninstalled django, and indeed that is now the first dependency that fails.

It seems that tox creates the virtualenv only once. If it did that, and you afterwards e.g. altered the requirements.txt file, or uninstalled a library like django, you need to re-create it:

To force tox to recreate a (particular) virtual environment:

tox --recreate -e py34  # [edited to py34]

would trigger a complete reinstallation of the
existing py27 environment (or create it afresh if it doesn’t exist).

copy of https://stackoverflow.com/a/50199089/1587329, edited to fit

Leave a comment