python - Django-google-analytics 导入错误

标签 python django google-analytics

我已经使用以下命令安装了 django-google-analytics:env/bin/pip install django-google-analytics 并回复:要求已经满足:django-google-analytics in ./env/lib/python2.7/site-packages

我已将 'google_analytics', 添加到 INSTALLED_APPS,并在 settings.py< 中添加 GOOGLE_ANALYTICS_MODEL = True/

当我运行env/bin/python manage.pysyncdb时,我得到ImportError:没有名为google_analytics的模块

我需要做什么?

编辑

如果有帮助的话,这是完整的回溯

cache cleared
cache settings imported
Traceback (most recent call last):
  File "manage.py", line 10, in <module>
    execute_from_command_line(sys.argv)
  File "/home/henry/Documents/culture.folder/src/culturegymnkitchen/env/local/lib/python2.7/site-packages/django/core/management/__init__.py", line 353, in execute_from_command_line
    utility.execute()
  File "/home/henry/Documents/culture.folder/src/culturegymnkitchen/env/local/lib/python2.7/site-packages/django/core/management/__init__.py", line 327, in execute
    django.setup()
  File "/home/henry/Documents/culture.folder/src/culturegymnkitchen/env/local/lib/python2.7/site-packages/django/__init__.py", line 18, in setup
    apps.populate(settings.INSTALLED_APPS)
  File "/home/henry/Documents/culture.folder/src/culturegymnkitchen/env/local/lib/python2.7/site-packages/django/apps/registry.py", line 85, in populate
    app_config = AppConfig.create(entry)
  File "/home/henry/Documents/culture.folder/src/culturegymnkitchen/env/local/lib/python2.7/site-packages/django/apps/config.py", line 90, in create
    module = import_module(entry)
  File "/usr/lib/python2.7/importlib/__init__.py", line 37, in import_module
    __import__(name)
ImportError: No module named google_analytics

最佳答案

问题是上传的新包正在更改正在使用的 django 版本。一旦排序完毕,它就会加载。

关于python - Django-google-analytics 导入错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/40912724/

相关文章:

python - "settings.DATABASES is improperly configured"与 django 1.6

javascript - 确定 Google Analytics 是否已加载

python - 当值不是唯一时,转置值并在python字典中键入键

python - 如何将html id添加到django的内置登录表单中

python - AWS Glue 截断 Redshift 表

python - 我可以将 apache mahout 与 django 应用程序一起使用吗

android - Firebase 不收集年龄和性别数据

jquery - 将 Ajax 调用记录到分析

python - 带有对数频率轴的 scipy 频谱图?

python - 为什么我的重复项目连续出现两次?