IDE error when open Python Console window

Traceback (most recent call last):
 File "/Applications/PyCharm.app/Contents/plugins/python/helpers/pydev/pydevconsole.py", line 11, in <module>
   from code import InteractiveConsole
 File "/usr/local/Cellar/python@3.9/3.9.17/Frameworks/Python.framework/Versions/3.9/lib/python3.9/code.py", line 10, in <module>
   from codeop import CommandCompiler, compile_command
 File "/usr/local/Cellar/python@3.9/3.9.17/Frameworks/Python.framework/Versions/3.9/lib/python3.9/codeop.py", line 69
   def _maybe_compile(compiler, source, filename, symbol):
   ^
SyntaxError: import * only allowed at module level
Couldn't connect to console process.
Process finished with exit code 1

0
3 comments

Is the issue project specific? 

Looks like the issue might be with a corrupted Python 3.9 installation. Can you open the Python console from outside the IDE?

What if you install a different Python version and create a new virtual environment for it on PyCharm? Does the behavior continue?

0

I think you're right on something wrong on Python 3.9 issues, this error on every projects, and same error in "manage.py shell"…

Don't have this issue before, It just started today, Any suggestion?

0

It's hard to pinpoint a specific reason on why it got corrupted so  probably the easiest way would be to reinstall Python 3.9 on your system or try to use a different Python version

0

Please sign in to leave a comment.