我有一个 django 项目,我正在尝试将其与 postgres 数据库连接。但是,当我尝试运行该命令时,python manage.py makemigrations出现以下错误:(card_crate_venv) G:\Shared drives\Card Crate\Software Development\card_crate_admin\website>python manage.py makemigrationsTraceback (most recent call last): File "G:\Shared drives\Card Crate\Software Development\card_crate_admin\website\manage.py", line 22, in <module> main() File "G:\Shared drives\Card Crate\Software Development\card_crate_admin\website\manage.py", line 18, in main execute_from_command_line(sys.argv) File "G:\Shared drives\Card Crate\Software Development\card_crate_admin\card_crate_venv\lib\site-packages\django\core\management\__init__.py", line 401, in execute_from_command_line utility.execute() File "G:\Shared drives\Card Crate\Software Development\card_crate_admin\card_crate_venv\lib\site-packages\django\core\management\__init__.py", line 377, in execute django.setup() File "G:\Shared drives\Card Crate\Software Development\card_crate_admin\card_crate_venv\lib\site-packages\django\__init__.py", line 24, in setup apps.populate(settings.INSTALLED_APPS) File "G:\Shared drives\Card Crate\Software Development\card_crate_admin\card_crate_venv\lib\site-packages\django\apps\registry.py", line 91, in populate app_config = AppConfig.create(entry) File "G:\Shared drives\Card Crate\Software Development\card_crate_admin\card_crate_venv\lib\site-packages\django\apps\config.py", line 90, in create module = import_module(entry)套餐:
1 回答
Cats萌萌
TA贡献1805条经验 获得超9个赞
我发现这不起作用,因为我使用 python 3.9 作为解释器。在 PyCharm 中,我创建了一个新的解释器,将基本解释器设置为 python 3.7 并重新安装了所有需要的包,它按预期工作
添加回答
举报
0/150
提交
取消