ImportError: No module named 'analytical'
apardes opened this issue · 8 comments
After installing on Ubuntu 14.04 running Python3.5 and Django 1.8.4 I'm getting an ImportError: No module named 'analytical'
error. A similar env running Mac OS 10.10.5 does not experience this issue.
I have added analytical
to my INSTALLED_APPS and added the basic template tags to my base template.
This is a very generic error saying the module is not installed.
- Can you elaborate how you installed Python 3.5 and
django-analytical
? - In the terminal, when you run
python3.5
and executeimport analytical
, does it work?
If you did run pip install django-analytical
you may have installed it for a different Python version on your system. Ubuntu 14.04 ships both Python 2.7 and 3.4 by default (but not 3.5).
Also check which Python version your Django installation is using. Try python manage.py shell
and check what's printed on the screen.
@apardes Aaaron, any news on this? Were you able to resolve the issue on your own?
I'm closing this issue for lack of activity/response. If this is still relevant please feel free to reopen it.
Hi Bittner, may I seek your advice as I encounter a similar problem when pushing my project to heroku.
ModuleNotFoundError: No module named 'analytical'.
I did my installation with pip install in virtual env and set my templates following the documentation. I'm on python 3.6 and django-analytical 2.3. I've also set the ID of the service I'm using as a heroku config var.
What could be the source of error please, thank you.
What does your setup look like? (requirements.txt, pip install commands, Heroku configuration and commands, etc.) Do you have code samples, or the whole project open sourced? It's difficult to help when you have to do heavy guessing,
Usually, what the error means is that you don't have the package installed.
Run pip freeze
on the host, or do some other checking, e.g. see the deployment log, on which packages are installed (for the Python version you're using to run the application! -- Installing for one python version and using a different one later may be one other source of the error).
thanks for being so detailed in your reply. it alerted me that i had not pip freeze to requirements.txt. i think the error is resolved. how do we check that django-analytics is operating well please? thank you.
How would you check that your code is working well that you added as plain JavaScript to your template?
Django-analytical is nothing more than a clean replacement for directly editing your template.
If you need a more technical answer: Look at the tests of the analytics integration you're using. Verify those steps manually.
Not too sure to be honest, will check it out. Thanks once again for your help, appreciate it!