Skip to content
Advertisement

Error installing cloud-sql-python-connector[pg8000] in Python 3.7

I am trying to connect to a Cloud SQL postgresql instance through python 3.7 from my local machine. I am following the guide from the README cloud-sql-python-connector. There it says to pip install the necessary module with the following command, for a postgresql instance:

JavaScript

But when I run this in my terminal, I get the following error:

JavaScript

There does exist the package cloud-sql-python-connector without the [pg8000] part associated to it, but then I can’t run the next part establishing a connection, because pg8000 is not defined:

JavaScript

Any advice on what I might be doing wrong would be appreciated!

Advertisement

Answer

It seems this is actually a long-running issue with the zsh terminal for mac users. It doesn’t like pip installs with the square brackets. See details here

As mentioned escaping the square brackets works and so should the following:

JavaScript
Advertisement