Psycopg2 for postgres connection


#1

Hi, I am working in python and need to connect to a postgres database regularly.
Before, I used to code in Eclipse and used the package psycopg2 for the postgres connection. psycopg2 also works well on other editor/platforms such as notebook jupyter.
Just yesterday, I started to give Atom a try but couldn’t find the package psycopg2 to be installed to run the same code. Instead, Atom seems to have its own postgres connecting library. And as far as I see this atom-psql package is only suitable for Atom.
Is this the only option? So, would I have to change all the postgres related code if I want to use Atom? Is it somehow possible to install psycopg2 in Atom and use the code directly?
Thanks!


#2

If you have used pip install psycopg2, then you don’t need to install anything. If you haven’t, then you need to install psycopg2 before you can use it. If you don’t have Python installed globally (because you’ve only ever been using Eclipse and Jupyter Notebook), then you should download it.

Instead, Atom seems to have its own postgres connecting library. And as far as I see this atom-psql package is only suitable for Atom.

Atom has no knowledge of or interaction with Python libraries.

Is it somehow possible to install psycopg2 in Atom and use the code directly?

No, you don’t install Python libraries in Atom, or inside any editor. You install them inside the distribution of Python that you’re using. Since Eclipse and Jupyter are full-featured IDEs, they both include Python. Any Atom package you use to run Python code will be calling a command outside of Atom, usually python.