csvkit: csvsql keeps telling me I don't have postgres library
I’m on OSX and am getting this msg whenever I try to run my csvsql command. Here’s the full command I’m using:
iconv -f latin1 -t UTF-8 +data/dump/${file}.txt |
csvcut --tabs --not-columns "ibis_client","company" |
csvsql --db "postgresql:///import_temp" --insert --table $file
Here’s the error:
You don't appear to have the necessary database backend installed for connection string you're trying to use. Available backends include:
Postgresql: pip install psycopg2
MySQL: pip install MySQL-python
For details on connection strings and other backends, please see the SQLAlchemy documentation on dialects at:
http://www.sqlalchemy.org/docs/dialects/
It keeps repeating that message (likely for every row that’s being created).
I do have psycopg2 installed correctly. I use Python and pip as installed via Homebrew (easier for me to manage). At first I thought this was an issue finding the correct library paths but everything is linked correctly (as far as I can tell). If I which pip and python both are running from /usr/local/bin.
I’m also using Postgres.app which is running from the default port.
There doesn’t seem to be any other issues regarding this, wondering if it’s something I’m doing wrong 😕
About this issue
- Original URL
- State: closed
- Created 8 years ago
- Comments: 17 (9 by maintainers)
Commits related to this issue
- Refactor bins to use pivot. Closes #522. — committed to lcorbasson/csvkit by onyxfish 8 years ago
- docs: Add troubleshooting for Homebrew, #522 — committed to wireservice/csvkit by jpmckinney 2 years ago
@tomjkidd Thanks! I’ve added a note to the docs.
I had the same problem on ubuntu using pip3 instead of pip solved the problem