简体   繁体   English

安装 django-observer package 的问题

[英]Problems installing django-observer package

Hello I am trying to install django-observer for python3 on my Win10 PC but I keep getting following error message:您好,我正在尝试在我的 Win10 PC 上为 python3 安装 django-observer,但我不断收到以下错误消息:

Collecting django-observer
  Using cached django-observer-0.4.3.tar.gz (7.4 kB)
Requirement already satisfied: django>=1.2 in c:\users\luca dieling\appdata\local\packages\pythonsoftwarefoundation.python.3.8_qbz5n2kfra8p0\localcache\local-packages\python38\site-packages (from django-observer) (3.1.4)
Collecting distribute
  Using cached distribute-0.7.3.zip (145 kB)
    ERROR: Command errored out with exit status 1:
     command: 'C:\Users\Luca Dieling\AppData\Local\Microsoft\WindowsApps\PythonSoftwareFoundation.Python.3.8_qbz5n2kfra8p0\python.exe' -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\Luca Dieling\\AppData\\Local\\Temp\\pip-install-k757dx1_\\distribute_c11e8be23eda49c7809d38d8e88b222e\\setup.py'"'"'; __file__='"'"'C:\\Users\\Luca Dieling\\AppData\\Local\\Temp\\pip-install-k757dx1_\\distribute_c11e8be23eda49c7809d38d8e88b222e\\setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' egg_info --egg-base 'C:\Users\Luca Dieling\AppData\Local\Temp\pip-pip-egg-info-00os3tdp'
         cwd: C:\Users\Luca Dieling\AppData\Local\Temp\pip-install-k757dx1_\distribute_c11e8be23eda49c7809d38d8e88b222e\
    Complete output (15 lines):
    Traceback (most recent call last):
      File "<string>", line 1, in <module>
      File "C:\Users\Luca Dieling\AppData\Local\Temp\pip-install-k757dx1_\distribute_c11e8be23eda49c7809d38d8e88b222e\setuptools\__init__.py", line 2, in <module>
        from setuptools.extension import Extension, Library
      File "C:\Users\Luca Dieling\AppData\Local\Temp\pip-install-k757dx1_\distribute_c11e8be23eda49c7809d38d8e88b222e\setuptools\extension.py", line 5, in <module>
        from setuptools.dist import _get_unpatched
      File "C:\Users\Luca Dieling\AppData\Local\Temp\pip-install-k757dx1_\distribute_c11e8be23eda49c7809d38d8e88b222e\setuptools\dist.py", line 7, in <module>
        from setuptools.command.install import install
      File "C:\Users\Luca Dieling\AppData\Local\Temp\pip-install-k757dx1_\distribute_c11e8be23eda49c7809d38d8e88b222e\setuptools\command\__init__.py", line 8, in <module>
        from setuptools.command import install_scripts
      File "C:\Users\Luca Dieling\AppData\Local\Temp\pip-install-k757dx1_\distribute_c11e8be23eda49c7809d38d8e88b222e\setuptools\command\install_scripts.py", line 3, in <module>
        from pkg_resources import Distribution, PathMetadata, ensure_directory
      File "C:\Users\Luca Dieling\AppData\Local\Temp\pip-install-k757dx1_\distribute_c11e8be23eda49c7809d38d8e88b222e\pkg_resources.py", line 1518, in <module>
        register_loader_type(importlib_bootstrap.SourceFileLoader, DefaultProvider)
    AttributeError: module 'importlib._bootstrap' has no attribute 'SourceFileLoader'
    ----------------------------------------
ERROR: Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.

I am running the command pip install django-observer我正在运行命令 pip install django-observer

Thank you for your help谢谢您的帮助

This django-observer package hasn't been maintained for a long time.这个django-observer package 好久没维护了。 The github repository states it works on Python 3 version 3.2 and 3.3 though. github 存储库声明它适用于 Python 3 版本 3.2 和 3.3。 So you might have luck setting up a virtualenv with python 3.2 or 3.3 and working from there.因此,您可能有幸使用 python 3.2 或 3.3 设置 virtualenv 并从那里开始工作。

The package appears to have done work similar to that of Django Signals. package 似乎完成了与 Django Signals 类似的工作。 You can read up on them here .你可以在这里阅读它们。 Signals are an implementation of the Observer pattern.信号是观察者模式的一种实现。

Just FYI, I tried installing the package too and got the same error on my MacOS machine.仅供参考,我也尝试安装 package 并在我的 MacOS 机器上遇到同样的错误。 This is why I suggest switching to Signals.这就是我建议切换到 Signals 的原因。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM