Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Install requires psycopg2 #15

Open
SabineHaas opened this issue Jan 28, 2019 · 3 comments
Open

Install requires psycopg2 #15

SabineHaas opened this issue Jan 28, 2019 · 3 comments

Comments

@SabineHaas
Copy link

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
Copy link

oakca commented Mar 19, 2019

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

@MGlauer
Copy link
Contributor

MGlauer commented Mar 19, 2019

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
Copy link
Contributor

Bachibouzouk commented Aug 29, 2019

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

Bachibouzouk pushed a commit to OpenEnergyPlatform/oeplatform that referenced this issue Sep 9, 2019
Change from psycopg-binary back to psycopg after discussion in
OpenEnergyPlatform/oedialect#15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants