为了账号安全,请及时绑定邮箱和手机立即绑定

ImportError:导入 _psycopg 时 DLL 加载失败:找不到指定的模块

ImportError:导入 _psycopg 时 DLL 加载失败:找不到指定的模块

Helenr 2023-12-12 15:05:05
我有一个 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 并重新安装了所有需要的包,它按预期工作



查看完整回答
反对 回复 2023-12-12
  • 1 回答
  • 0 关注
  • 144 浏览
慕课专栏
更多

添加回答

举报

0/150
提交
取消
意见反馈 帮助中心 APP下载
官方微信