Попытка подключения к БД PostgreSQL с помощью Pony ORM. Запуск скрипта из venv с установленными пакетами pony и psycopg2 . скриншот Но все равно есть исключение:
D:\***\venv\Scripts\python.exe D:/***/models.py
Traceback (most recent call last):
File "D:\***\venv\lib\site-packages\pony\orm\dbproviders\postgres.py", line 9, in <module>
import psycopg2
File "D:\***\venv\lib\site-packages\psycopg2\__init__.py", line 50, in <module>
from psycopg2._psycopg import ( # noqa
ImportError: DLL load failed while importing _psycopg: Не найден указанный модуль.
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "D:\***\venv\lib\site-packages\pony\orm\dbproviders\postgres.py", line 12, in <module>
from psycopg2cffi import compat
ModuleNotFoundError: No module named 'psycopg2cffi'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "D:/***/models.py", line 6, in <module>
db.bind(**DB_CONFIG)
File "D:\***\venv\lib\site-packages\pony\orm\core.py", line 769, in bind
self._bind(*args, **kwargs)
File "D:\***\venv\lib\site-packages\pony\orm\core.py", line 788, in _bind
provider_module = import_module('pony.orm.dbproviders.' + provider)
File "D:\***\venv\lib\site-packages\pony\utils\utils.py", line 219, in import_module
mod = __import__(name)
File "D:\***\venv\lib\site-packages\pony\orm\dbproviders\postgres.py", line 14, in <module>
raise ImportError('In order to use PonyORM with PostgreSQL please install psycopg2 or psycopg2cffi')
ImportError: In order to use PonyORM with PostgreSQL please install psycopg2 or psycopg2cffi