sqlalchemy.exc.NoSuchModuleError: Can’t load plugin: sqlalchemy.dialects:postgres
The URI should start with postgresql:// instead of postgres://. SQLAlchemy used to accept both, but has removed support for the postgres name.
The URI should start with postgresql:// instead of postgres://. SQLAlchemy used to accept both, but has removed support for the postgres name.
For anyone looking for a solution for this on macOS Sierra 10.12 (or later, most likely): I fixed this by installing the command line tools: xcode-select –install After that, pip install psycopg2 should work. If it doesn’t, you could also try to link against brew’s openssl: env LDFLAGS=”-I/usr/local/opt/openssl/include -L/usr/local/opt/openssl/lib” pip install psycopg2 with openssl installed … Read more
From “Programming Python” by Mark Lutz: curs.execute(“Select * FROM people LIMIT 0”) colnames = [desc[0] for desc in curs.description]
I built a program that inserts multiple lines to a server that was located in another city. I found out that using this method was about 10 times faster than executemany. In my case tup is a tuple containing about 2000 rows. It took about 10 seconds when using this method: args_str=”,”.join(cur.mogrify(“(%s,%s,%s,%s,%s,%s,%s,%s,%s)”, x) for x … Read more
This is what postgres does when a query produces an error and you try to run another query without first rolling back the transaction. (You might think of it as a safety feature, to keep you from corrupting your data.) To fix this, you’ll want to figure out where in the code that bad query … Read more
Note: Since a while back, there are binary wheels for Windows in PyPI, so this should no longer be an issue for Windows users. Below are solutions for Linux, Mac users, since lots of them find this post through web searches. Option 1 Install the psycopg2-binary PyPI package instead, it has Python wheels for Linux … Read more
pg_config is in postgresql-devel (libpq-dev in Debian/Ubuntu, libpq-devel on Centos/Fedora/Cygwin/Babun.)