when importing version 3.7 and running natively, it issues and exception:
import psycopg2 File "/opt/psycopg2/__init__.py", line 68, in <module> import psycopg2.extensions as _ext File "/opt/psycopg2/extensions.py", line 211, in <module> from psycopg2. _range import Range # noqa File "/opt/psycopg2/_range.py", line 502, in <module> oid=3904, subtype_oid=23, array_oid=3905) File "/opt/psycopg2/_range.py", line 283, in __init__ self._create_ranges(pgrange, pyrange) File "/opt/psycopg2/_range.py", line 302, in _create_ranges if isinstance(pgrange, basestring): NameError: name 'basestring' is not defined
a solution is to replace basestring with str
when importing version 3.7 and running natively, it issues and exception:
import psycopg2 File "/opt/psycopg2/__init__.py", line 68, in <module> import psycopg2.extensions as _ext File "/opt/psycopg2/extensions.py", line 211, in <module> from psycopg2. _range import Range # noqa File "/opt/psycopg2/_range.py", line 502, in <module> oid=3904, subtype_oid=23, array_oid=3905) File "/opt/psycopg2/_range.py", line 283, in __init__ self._create_ranges(pgrange, pyrange) File "/opt/psycopg2/_range.py", line 302, in _create_ranges if isinstance(pgrange, basestring): NameError: name 'basestring' is not defined
a solution is to replacebasestring
withstr