OpenEnergyPlatform / oedialect

Repository for an SQLAlchemy dialect using the OEP's REST-API
GNU Affero General Public License v3.0
2 stars 3 forks source link

Install requires psycopg2 #15

Open SabineHaas opened 5 years ago

SabineHaas commented 5 years ago

When I import oedialect (installed via pip) I get the following error message.

 File ".../lib/python3.6/site-packages/oedialect/__init__.py", line 2, in <module>
from psycopg2 import *
ModuleNotFoundError: No module named 'psycopg2'
Backend TkAgg is interactive backend. Turning interactive mode on.
We've got an error while stopping in post-mortem: <class 'KeyboardInterrupt'>

I'd suggest to add psycopg2 to the setup file.

oakca commented 5 years ago

Because of the ~depreciation~ warning, I am suggesting psycopg2-binary instead of psycopg2

MGlauer commented 5 years ago

I am still not sure about that. The warning is not a deprecation warning. The problem is a known issue with concurrent database connections that might lead to random segfault when using wheels. Thus, psycopg is splitting into two modes of installation:

  1. With psycopg2-binary allowing the continued use of wheels with the advantage that no C compiler is needed but at the risk of segfaults
  2. As usual with psycopg2: No segfaults, but a C compiler is required. This warning should disappear with psycopg2.8

Especially with long running simulation scripts, I would argue to choose reliability over convenience.

Bachibouzouk commented 5 years ago

Since #19 is merged, this issue could be closed.

However in #19 psycopg2-binary was chosen over psycopg2. I tried the install pip install psycopg2 and I had an error message which told me :

Error: 'You need to install postgresql-server-dev-NN for building a 
server-side extension or libpq-dev for building a client-side application.'

After sudo apt install libpq-dev, pip install psycopg2 worked :) (I have Ubuntu 18.04.2 LTS)

If @MGlauer says it is more reliable, I would also vote for psycopg2