gpt4 book ai didi

python - makemigration 导致错误 "TypeError: expected str, bytes or os.PathLike object, not NoneType"

转载 作者:太空宇宙 更新时间:2023-11-04 04:12:36 24 4
gpt4 key购买 nike

在 docker 容器中运行 makemigration 命令导致了这个错误,谁能帮我找出问题所在?

python3.7 manage.py makemigrations
Traceback (most recent call last):
File "/usr/local/lib/python3.7/site-packages/reportlab/lib/utils.py", line 667, in open_for_read
return open_for_read_by_name(name,mode)
File "/usr/local/lib/python3.7/site-packages/reportlab/lib/utils.py", line 611, in open_for_read_by_name
return open(name,mode)
TypeError: expected str, bytes or os.PathLike object, not NoneType

最佳答案

请检查是否缺少 your_app/migrations/__init__.py

如果它不存在,django 可能会抛出这个异常,在这种情况下会抛出 solition

-> 添加__init__.py 再次执行python manage.py makemigrations

关于python - makemigration 导致错误 "TypeError: expected str, bytes or os.PathLike object, not NoneType",我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/56070036/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com