2

我正在尝试安装 django-tracker 并将其提取到一个目录中,现在当我运行 python setup.py 时,我收到了以下错误

     vikas@vikas-laptop:~/djcode/django-tracking-0.4.1$ python setup.py
     Traceback (most recent call last):
     File "setup.py", line 6, in <module>
     import tracking
     File "/home/vikas/djcode/django-tracking-0.4.1/tracking/__init__.py", line 1, in      <module>
    import listeners
     File "/home/vikas/djcode/django-tracking-0.4.1/tracking/listeners.py", line 6, in       <module>
     from django.core.cache import cache
     File "/usr/local/lib/python2.7/dist-packages/django/core/cache/__init__.py", line 70, in    <module>
     if DEFAULT_CACHE_ALIAS not in settings.CACHES:
    File "/usr/local/lib/python2.7/dist-packages/django/conf/__init__.py", line 53, in __getattr__
self._setup(name)
 File "/usr/local/lib/python2.7/dist-packages/django/conf/__init__.py", line 46, in _setup
% (desc, ENVIRONMENT_VARIABLE))
 django.core.exceptions.ImproperlyConfigured: Requested setting CACHES, but settings    are not configured. You must either define the environment variable DJANGO_SETTINGS_MODULE or call settings.configure() before accessing settings.

谁能帮我解决这个问题?

4

3 回答 3

4

尝试以下替代方法:

pip install git+https://github.com/bashu/django-tracking.git

这对我有用。以下是相同的痕迹:

root@3239fee56ba9:/home/docker/code/gstudio/gnowsys-ndf# pip install git+https://github.com/bashu/django-tracking.git
采集git+https://github.com/bashu/django-tracking.git
  克隆 https://github.com/bashu/django-tracking.git 到 /tmp/pip-IMNBJq-build
已满足要求(使用 --upgrade 升级):/usr/local/lib/python2.7/dist-packages 中的 django>=1.4(来自 django-tracking==0.4.1)
安装收集的包:django-tracking
  为 django-tracking 运行 setup.py install ...完成
成功安装django-tracking-0.4.1
于 2016-04-21T14:54:15.757 回答
1

django-tracking 需要一些修复才能与 Django 1.5 和 1.6 一起使用。

我在这里创建了一个叉子https://github.com/pcraston/django-tracking

(Django 1.5 的修复从https://bitbucket.org/romanalexander/django-tracking复制)

于 2013-11-06T16:22:14.110 回答
0

你应该给 python setup.py 一个特定的命令。如果您想安装它,请执行以下操作:

$ python setup.py install

如果您希望对软件包进行改进以增强它,请执行以下操作:

$ python setup.py develop

当然,不用说这应该发生在virtualenv中,如果你正在安装包,你可以通过pip来安装。

于 2013-09-21T09:14:18.437 回答