python3 Debug報錯 Traceback (most recent call last)


記錄一下,剛入門學習python3,模塊可以run,但是debug報錯

下面貼出報錯信息

--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

D:\Anaconda\python.exe "D:\jetbrains\PyCharm 2019.1.2\helpers\pydev\pydevd.py" --multiproc --qt-support=pyside --client 127.0.0.1 --port 6835 --file D:/PythonDemo/code/cal.py
Traceback (most recent call last):
File "D:\jetbrains\PyCharm 2019.1.2\helpers\pydev\_pydevd_bundle\pydevd_cython_wrapper.py", line 2, in <module>
from _pydevd_bundle_ext.pydevd_cython import trace_dispatch, PyDBAdditionalThreadInfo, global_cache_skips, global_cache_frame_skips
ModuleNotFoundError: No module named '_pydevd_bundle_ext'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "D:\jetbrains\PyCharm 2019.1.2\helpers\pydev\_pydevd_bundle\pydevd_console_integration.py", line 2, in <module>
from code import InteractiveConsole
ImportError: cannot import name 'InteractiveConsole' from 'code' (D:\PythonDemo\code\__init__.py)

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "D:\jetbrains\PyCharm 2019.1.2\helpers\pydev\pydevd.py", line 28, in <module>
from _pydevd_bundle.pydevd_additional_thread_info import PyDBAdditionalThreadInfo
File "D:\jetbrains\PyCharm 2019.1.2\helpers\pydev\_pydevd_bundle\pydevd_additional_thread_info.py", line 17, in <module>
from _pydevd_bundle.pydevd_cython_wrapper import PyDBAdditionalThreadInfo
File "D:\jetbrains\PyCharm 2019.1.2\helpers\pydev\_pydevd_bundle\pydevd_cython_wrapper.py", line 32, in <module>
mod = __import__(check_name)
File "_pydevd_bundle\pydevd_cython_win32_37_64.pyx", line 139, in init _pydevd_bundle.pydevd_cython_win32_37_64
File "D:\jetbrains\PyCharm 2019.1.2\helpers\pydev\_pydevd_bundle\pydevd_breakpoints.py", line 16, in <module>
from _pydevd_bundle.pydevd_comm import get_global_debugger
File "D:\jetbrains\PyCharm 2019.1.2\helpers\pydev\_pydevd_bundle\pydevd_comm.py", line 80, in <module>
from _pydevd_bundle import pydevd_console_integration
File "D:\jetbrains\PyCharm 2019.1.2\helpers\pydev\_pydevd_bundle\pydevd_console_integration.py", line 4, in <module>
from _pydevd_bundle.pydevconsole_code_for_ironpython import InteractiveConsole
File "D:\jetbrains\PyCharm 2019.1.2\helpers\pydev\_pydevd_bundle\pydevconsole_code_for_ironpython.py", line 305
exec code in self.locals
^
SyntaxError: Missing parentheses in call to 'exec'

Process finished with exit code 1

--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

 

報錯的大意是找不到指定模塊。

隨即到v2ex找網友詢問

@leishi1313

@CHYK

@necomancer

@goofool

這幾位老哥提醒我

可能是因為存放demo模塊的文件夾起名叫做code導致不能正常識別,因為本人是新手,不清楚這個code是哪里需要的關鍵字

但這個操作導致我莫名其妙的不能導入同文件夾內的其他函數和類。

希望可以幫到別人。

v2鏈接

https://www.v2ex.com/t/589367

 


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM