我正在 Linux 服务器上部署我的 Django 项目。当我运行命令 python manage.pycollectstatic
时,出现以下错误:
File "/home/student/PickFeel/venv/lib/python3.5/site-packages/django/db/models/enums.py", line 81, in TextChoices
def _generate_next_value_(name, start, count, last_values):
File "/usr/lib/python3.5/enum.py", line 61, in __setitem__
raise ValueError('_names_ are reserved for future Enum use')
ValueError: _names_ are reserved for future Enum use
enum.py是系统生成的文件。
如何解决这个问题?
最佳答案
发生这种情况是因为 python3.5
不支持枚举的 _missing_
函数。 python3.8
see here from the docs 支持它
考虑将您的 python 版本升级到 3.8
或支持 _missing_
函数的任何其他版本。
如果您已经有最新版本,请使用合适的命令,例如而不是这个
python manage.py collectstatic
做
python3.x manage.py collectstatic
关于python - 错误: 'ValueError: _names_ are reserved for future Enum use' ,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/61531021/