簡體   English   中英

嘗試安裝 Django 反轉

[英]Trying to install Django reversion

我正在嘗試設置一個 Django 項目,但我得到了這個:

python2.7 manage.py migrate
Traceback (most recent call last):
  File "manage.py", line 10, in <module>
    execute_from_command_line(sys.argv)
  File "/usr/local/lib/python2.7/dist-packages/django/core/management/__init__.py", line 364, in execute_from_command_line
    utility.execute()
  File "/usr/local/lib/python2.7/dist-packages/django/core/management/__init__.py", line 338, in execute
    django.setup()
  File "/usr/local/lib/python2.7/dist-packages/django/__init__.py", line 27, in setup
    apps.populate(settings.INSTALLED_APPS)
  File "/usr/local/lib/python2.7/dist-packages/django/apps/registry.py", line 85, in populate
    app_config = AppConfig.create(entry)
  File "/usr/local/lib/python2.7/dist-packages/django/apps/config.py", line 94, 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 reversion

所以我正在嘗試安裝reversion,但是在嘗試安裝enter code here時收到此錯誤消息:

$sudo pip install django-reversion
Downloading/unpacking django-reversion
  Downloading django-reversion-3.0.7.tar.gz (67kB): 67kB downloaded
  Running setup.py (path:/tmp/pip_build_root/django-reversion/setup.py) egg_info for package django-reversion
    Traceback (most recent call last):
      File "<string>", line 17, in <module>
      File "/tmp/pip_build_root/django-reversion/setup.py", line 28, in <module>
        long_description=read('README.rst'),
      File "/tmp/pip_build_root/django-reversion/setup.py", line 19, in read
        with open(filepath, "r", encoding="utf-8") as f:
    TypeError: 'encoding' is an invalid keyword argument for this function
    Complete output from command python setup.py egg_info:
    Traceback (most recent call last):

  File "<string>", line 17, in <module>

  File "/tmp/pip_build_root/django-reversion/setup.py", line 28, in <module>

    long_description=read('README.rst'),

  File "/tmp/pip_build_root/django-reversion/setup.py", line 19, in read

    with open(filepath, "r", encoding="utf-8") as f:

TypeError: 'encoding' is an invalid keyword argument for this function

----------------------------------------
Cleaning up...
Command python setup.py egg_info failed with error code 1 in /tmp/pip_build_root/django-reversion
Storing debug log for failure in /home/tirengarfio/.pip/pip.log

我在 Ubuntu 16.04 和 python 2.7 上。

僅 Python3 的open()是在 3.0.6 版中添加的。 嘗試早期版本,3.0.5 或 3.0.4:

pip install django-reversion==3.0.5

或者

pip install django-reversion==3.0.4

Django 3 支持 python 版本 3.6 及更高版本。

這是官方的 Django 3.0 發行說明

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM