ImportError: 名前 'InteractiveConsole' を 'code' (/PycharmProjects/PyTorch_Test/code.py) からインポートできません
上記の例外の処理中に、別の例外が発生しました。
トレースバック (最新の呼び出しは最後):
ファイル "/Applications/PyCharm.app/Contents/plugins/python/helpers/pydev/pydevd.py"、行 45、<module> 内、
_pydevd_bundle.pydevd_comm import CMD_SET_BREAK、CMD_SET_NEXT_STATEMENT、CMD_STEP_INTO、 CMD_STEP_OVER, \
ファイル "/Applications/PyCharm.app/Contents/plugins/python/helpers/pydev/_pydevd_bundle/pydevd_comm.py"、91 行目、<module> 内
_pydevd_bundle から import pydevd_console_integration
ファイル "/Applications/PyCharm.app/Contents /plugins/python/helpers/pydev/_pydevd_bundle/pydevd_console_integration.py"、<module> の 6 行目、
_pydevd_bundle.pydevconsole_code_for_ironpython から import InteractiveConsole
ファイル「/Applications/PyCharm.app/Contents/plugins/python/helpers/pydev/_pydevd_bundle/pydevconsole_code_for_ironpython.py」、self.localsの実行 コード 305 行目
^
SyntaxError: 'exec' の呼び出しに括弧がありません
.py の名前を code.py に変更します。
競合しないように名前を変更するだけです。