django - 尝试安装 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 上。
解决方案
仅 Python3open()
是在 3.0.6 版中添加的。尝试早期版本,3.0.5 或 3.0.4:
pip install django-reversion==3.0.5
或者
pip install django-reversion==3.0.4
推荐阅读
- r - 针对同一常数查找一系列变量的值
- c# - C# DataTable OrderBy 错误排序
- java - GetMax() 方法的递归关系
- google-apps-script - TypeError:无法从未定义中读取属性“值”。(第 2 行,文件“代码”)
- selenium - 在 DigitalOcean 中运行无头 Firefox 或 chrome
- mysql - MySQL - 将字段限制为最多 5 次出现
- google-sheets - countIf 合并单元格
- phpunit - 在 phpunit 测试中抑制 symfony 4 响应主体
- typescript - TypeScript Sinon 调用假返回类型不匹配
- kotlin - 如何声明一组固定字符串的 Kotlin 类型?