

Please don't use psycopg2 at the moment unless you're really confident you know how to install it.Īlright, now that that's out of the way. That's because when you're doing some really advanced stuff, there can be some problems with psycopg2-binary. In addition, you'll have to find some files and programs in your computer that can be quite difficult to find!Īs you learn more and more and because a proficient (maybe professional) software developer, you will want to use psycopg2 instead of psycopg2-binary. To install psycopg2 there are a bunch of prerequisites that you probably won't have already installed. That's because when you install psycopg2-binary, it will just work. Don't install psycopg2 at all, and certainly don't install both packages. So what's the difference? # psycopg2 vs psycopg2-binaryīecause we're only just starting (and I'm assuming most students are fairly new to software development and programming), you should use psycopg2-binary only. There's two libraries: psycopg2 and psycopg2-binary. However as we'll learn throughout the course, there's a lot more we can do with psycopg2.īut when you're getting started with psycopg2 there is an initial hurdle. The main things remain the same: we create connections, we create cursor, we execute queries. The sqlite3 library is simpler than psycopg2 just as SQLite is simpler than PostgreSQL. Just as we used the sqlite3 library in Python to talk to a SQLite database, we'll use psycopg2 to talk to a PostgreSQL database.

# PostgreSQL Python Libraries: psycopg2 and psycopg2-binary
