You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
hey, I noticed that I can't use psycop2 in my rest api any more, I installed it on a new pc and when I run i get this error:
PS C:\Users\arch\OneDrive\desktop\monitoring-system-backend> & C:/Users/arch/AppData/Local/Programs/Python/Python313/python.exe "c:/Users/arch/OneDrive/desktop/monitoring-system-backend/app.py"
Traceback (most recent call last):
File "c:\Users\arch\OneDrive\desktop\monitoring-system-backend\app.py", line 4, in
from psycopg2.extras import RealDictCursor
File "C:\Users\omrig\AppData\Local\Programs\Python\Python313\Lib\site-packages\psycopg2_init_.py", line 51, in
from psycopg2._psycopg import ( # noqa
...<10 lines>...
)
ImportError: DLL load failed while importing _psycopg: The specified module could not be found.
this is my code if helpful:
from flask import Flask, jsonify, request
import json
from flask_cors import CORS
from psycopg2.extras import RealDictCursor
from datetime import datetime, timedelta
import psycopg2
from constants import DB_HOST, DB_NAME, DB_USER, DB_PASS
from threading import Thread
from multiprocessing import Process
from werkzeug.serving import WSGIRequestHandler
import logging
import time
hey, I noticed that I can't use psycop2 in my rest api any more, I installed it on a new pc and when I run i get this error:
PS C:\Users\arch\OneDrive\desktop\monitoring-system-backend> & C:/Users/arch/AppData/Local/Programs/Python/Python313/python.exe "c:/Users/arch/OneDrive/desktop/monitoring-system-backend/app.py"
Traceback (most recent call last):
File "c:\Users\arch\OneDrive\desktop\monitoring-system-backend\app.py", line 4, in
from psycopg2.extras import RealDictCursor
File "C:\Users\omrig\AppData\Local\Programs\Python\Python313\Lib\site-packages\psycopg2_init_.py", line 51, in
from psycopg2._psycopg import ( # noqa
...<10 lines>...
)
ImportError: DLL load failed while importing _psycopg: The specified module could not be found.
this is my code if helpful:
from flask import Flask, jsonify, request
import json
from flask_cors import CORS
from psycopg2.extras import RealDictCursor
from datetime import datetime, timedelta
import psycopg2
from constants import DB_HOST, DB_NAME, DB_USER, DB_PASS
from threading import Thread
from multiprocessing import Process
from werkzeug.serving import WSGIRequestHandler
import logging
import time
app = Flask(name)
CORS(app)
def get_db_connection(): # * config
try:
postgres = psycopg2.connect(
host=DB_HOST,
database=DB_NAME,
user=DB_USER,
password=DB_PASS
)
return postgres
The text was updated successfully, but these errors were encountered: