psycopg2 Questions

6

Solved

Hi I'd like to get a table from a database, but include the field names so I can use them from column headings in e.g. Pandas where I don't necessarily know all the field names in advance so if my...
Serrano asked 17/6, 2013 at 8:18

4

When I try importing psycopg2, I get this error message: ImportError: dlopen(/opt/homebrew/lib/python3.10/site-packages/psycopg2/_psycopg.cpython-310-darwin.so, 0x0002): Library not loaded: /opt/ho...
Detergency asked 6/9, 2022 at 17:30

5

I'm having issues building wheel for psycopg2 thru pip install -r requirements.txt. I'm on ubuntu 20.04 + python 3.8.5 + venv. This is my requirements.txt: amqp==2.6.1 anyjson==0.3.3 asgiref==3.2.1...
Esquiline asked 21/1, 2021 at 4:44

13

Does psycopg2 have a function for escaping the value of a LIKE operand for Postgres? For example I may want to match strings that start with the string "20% of all", so I want to write something l...
Nonsuch asked 21/1, 2010 at 0:58

27

Solved

I'm trying to install Psycopg2 on my Macbook, but I am getting an error. I found a lot of the same questions on StackOverflow but no answer seems to work. I'm using: OS: MacOS 10.9.5 Python Versi...
Spec asked 23/11, 2015 at 8:42

55

I am having trouble installing psycopg2. I get the following error when I try to pip install psycopg2: Error: pg_config executable not found. Please add the directory containing pg_config to the ...
Repertory asked 23/7, 2012 at 19:9

2

Does anyone know how to fix this import error? I am working on macOS Monterey version 12.0.1. from psycopg2._psycopg import (# noqa ImportError: dlopen(/Users/myname/data-env/lib/python3.8/site-pac...
Teutonize asked 1/4, 2022 at 23:37

8

pg_config venv ❯ which pg_config /Applications/Postgres.app/Contents/Versions/latest/bin/pg_config pip3 install -r requirements.txt requirements.txt venv ❯ cat requirements.txt -i https://mirr...
Latimore asked 29/11, 2020 at 10:51

2

When I tried to import psycopg2 with this simple line of code: import psycopg2 The following error occurs: Traceback (most recent call last): File "<stdin>", line 1, in <module...
Gesualdo asked 16/4, 2019 at 2:51

8

What is the best way to insert a Python dictionary with many keys into a Postgres database without having to enumerate all keys? I would like to do something like... song = dict() song['title'] =...
Pulido asked 5/4, 2015 at 20:34

8

I'm trying to connect to a Postgres database with SQLAlchemy. I've installed psycopg2. However, I get the error sqlalchemy.exc.NoSuchModuleError: Can't load plugin: sqlalchemy.dialects:postgres. Ho...

2

Solved

My projects is running postgreSQL and after I upgraded my system to ubuntu 16.04, and cloned the project again, I am not able to install the particular package. I have also tried to purge postgre...
Concoct asked 3/2, 2018 at 5:55

3

Solved

I want to use the sql submodule of psycopg2 to write clean dynamic SQL: from psycopg2 import sql ... cursor.execute(sql.SQL("SELECT * FROM {}").format(sql.Identifier('myschema.mytable')) This cr...
Portable asked 5/6, 2018 at 9:45

10

Solved

I have the following code, using pscyopg2: sql = 'select %s from %s where utctime > %s and utctime < %s order by utctime asc;' data = (dataItems, voyage, dateRangeLower, dateRangeUpper) rows...
Sourpuss asked 10/12, 2012 at 0:23

2

I need to upgrade the following code to some equivalent code based on psycopg version 3: import psycopg2 from sqlalchemy import create_engine engine = create_engine('postgresql+psycopg2://', creat...
Garnettgarnette asked 3/9, 2022 at 23:55

23

Trying to setup postgres with the postgres mac app and hit this error, which I haven't been able to solve. Any thoughts? ImportError: dlopen(/Users/Craig/pyenv/mysite/lib/python2.7/site-packages/...
Neoplasm asked 6/5, 2013 at 22:0

7

Can someone please explain how I can get the tables in the current database? I am using postgresql-8.4 psycopg2.
Tideland asked 15/5, 2012 at 9:38

2

Solved

Are there any examples of how to pass parameters with an SQL query in Pandas? In particular I'm using an SQLAlchemy engine to connect to a PostgreSQL database. So far I've found that the following ...
Casket asked 25/6, 2014 at 12:21

1

I am facing issues committing to my RDS postgres instance using psycopg2. Everything was working fine earlier, just started noticing it recently. What does this error mean? Is there anyway my post...
Culch asked 17/10, 2019 at 19:30

15

Solved

I've tried to install psycopg2 (PostgreSQL Database adapater) from this site, but when I try to install after I cd into the package and write python setup.py install I get the following error:...
Playpen asked 30/1, 2016 at 16:25

8

Solved

I recently uninstalled postgresql and installed pyscopg2 via pip. I know there's some trickery involved with libcrypto and libssl Currently i have them symlinked to: $ ls -lah libssl.* -rwxr-xr-...
Chart asked 30/11, 2012 at 10:33

12

Solved

I tried to install psycopg2 to my environment, but I get the following error: (venv)avlahop@apostolos-laptop:~/development/django/rhombus-dental$ sudo pip install psycopg2 Downloading/unpacking ps...
Liquidize asked 8/4, 2014 at 13:33

2

Solved

Looking at the output of select * from pg_stat_activity;, I see a column called application_name, described here. I see psql sets this value correctly (to psql...), but my application code (psycop...
Opuntia asked 28/3, 2013 at 15:29

17

Solved

I am setting up a new Django project to deploy on Heroku, however when I am following the Django Heroku deployment guide I come across an error during 'pip install django-heroku'. I am running on:...
Marmoreal asked 31/7, 2019 at 4:58

2

Solved

We need to do bulk updates of many rows in our Postgres DB, and want to use the SQL syntax below. How do we do that using psycopg2? UPDATE table_to_be_updated SET msg = update_payload.msg FROM (VA...
Salvatore asked 20/9, 2019 at 17:43

© 2022 - 2024 — McMap. All rights reserved.