Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
251 views
in Technique[技术] by (71.8m points)

python - Import pg erroring out in Python3.9

whenever I use import pg in my code I get following error

>>> import pg
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/usr/local/lib/python3.9/site-packages/pg/__init__.py", line 3
    async,
    ^
SyntaxError: invalid syntax

I tried it using pyCharm and terminal directly as well. I am using Python3.9 , import sys; print(sys.version) output

3.9.1 (default, Dec 29 2020, 08:52:17)
[Clang 12.0.0 (clang-1200.0.32.28)]

My objective is to use connect to redshift. However I am able to use pg8000 but what does this error mean? As per documentation online async was added after python 3.3 and since I am using 3.9 it should get imported without error

question from:https://stackoverflow.com/questions/65623002/import-pg-erroring-out-in-python3-9

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)
Waitting for answers

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...