https://app.dataquest.io/m/250/project%3A-postgresql-installation/2/installing-postgresql
Add the following line to the end of ~/.bash_profile:
export PATH=$PATH:/Applications/Postgres.app/Contents/Versions/latest/bin
when I ran this in the terminal window, I didn’t get a response, is that what is expected?
Additionally, there are two other instructions on subsequent pages:
Page 3:
pip install psycopg2
I ran pip install psycopg2-binary
and it worked, is this the same thing?
or
conda install psycopg2
Page 4:
Launch your Python shell and import the psycopg2 library.
Is Python shell the same as IDLE?
when I run this here, I get:
Traceback (most recent call last):
File “<pyshell#0>”, line 1, in
import psycopg2
ModuleNotFoundError: No module named ‘psycopg2’
Then, run the following code to connect to PostgreSQL and test that everything works as expected:
Where do I run the following code from? I attempted to run it in a Jupyter notebook, but when I query the tables notes, I get an error, Undefined table?
import psycopg2
conn = psycopg2.connect(dbname=“postgres”, user=“postgres”)
cursor = conn.cursor()
cursor.execute(“CREATE TABLE notes(id integer PRIMARY KEY, body text, title text)”)
conn.close()