tk0miya / testing.postgresql

Apache License 2.0
290 stars 46 forks source link

Psycopg2 not found #46

Open asis5d opened 6 months ago

asis5d commented 6 months ago

I can see the documentation mentions pg8000 as one of the requirements for this package to run. But following the basic steps from the documentation, I run into the error that says: ModuleNotFoundError: No module named 'psycopg2'. As I dug into it, in the snippet:

engine = create_engine(postgresql.url())

the url() method looks like this:

def url(self, **kwargs):
        params = self.dsn(**kwargs)

        url = ('postgresql://%s@%s:%d/%s' %
               (params['user'], params['host'], params['port'], params['database']))

        return url

And since the url doesn't explicitly mention the pg8000 driver, I am getting the error. Is there any workaround for this if I don't want to install psycopg2?