导入错误:无法从'IPython.core.debugger'导入名称'Pdb'



看来我根本无法使用Jupyter notebook。我已经尝试卸载并再次安装,但此错误仍然存在。

[I 19:33:14.916 NotebookApp] 内核重启器:重新启动内核 (1/5(, 新的随机端口回溯(最近一次调用(:文件 "/usr/local/Cellar/python/3.7.4_1/Frameworks/Python.framework/Versions/3.7/lib/python3.7/runpy.py", 193号线,_run_module_as_main ">main", mod_spec( 文件 "/usr/local/Cellar/python/3.7.4_1/Frameworks/Python.framework/Versions/3.7/lib/python3.7/runpy.py", 第 85 行,_run_code exec(code, run_globals( File "/usr/local/lib/python3.7/site-packages/ipykernel_launcher.py", line 15, 英寸 从 ipykernel import kernelapp as app File "/usr/local/lib/python3.7/site-packages/ipykernel/init.py", line 2、在 从 .connect import * 文件 "/usr/local/lib/python3.7/site-packages/ipykernel/connect.py",行 13, 在 从 IPython.core.profiledir import ProfileDir 文件 "/usr/local/lib/python3.7/site-packages/IPython/init.py",第 54 行, 在 从 .core.application import Application File "/usr/local/lib/python3.7/site-packages/IPython/core/application.py", 第 25 行,在 从 IPython.core 导入版本,crashhandler 文件 "/usr/local/lib/python3.7/site-packages/IPython/core/crashhandler.py", 第 27 行,在 从 IPython.core import ultratb 文件 "/usr/local/lib/python3.7/site-packages/IPython/core/ultratb.py", line 115,在 从 IPython.core 导入调试器文件 "/usr/local/lib/python3.7/site-packages/IPython/core/debugger.py", 第 47 行,在 从 pdb 导入 pdb 作为 OldPdb 文件 "/usr/local/Cellar/python/3.7.4_1/Frameworks/Python.framework/Versions/3.7/lib/python3.7/pdb.py", 第 76 行,在 导入代码文件"/用户/机器人/保管箱/编码/ytautomator/temp/testing_code/code.py", 第 17 行,在 fig, ax = plt.subplots(figsize=(15, 8(( File "/usr/local/lib/python3.7/site-packages/matplotlib/pyplot.py", line 1209,在子图中 fig = figure(**fig_kw( File "/usr/local/lib/python3.7/site-packages/matplotlib/pyplot.py", line 545,图中 **kwargs( 文件 "/usr/local/lib/python3.7/site-packages/matplotlib/backend_bases.py", 3251行,new_figure_manager fig = fig_cls(*args, **kwargs( File "/usr/local/lib/python3.7/site-packages/matplotlib/figure.py", line 367, ininitFigureCanvasBase(self( # set self.canvas. 文件 "/usr/local/lib/python3.7/site-packages/matplotlib/backend_bases.py", 第 1582 行,在initself._fix_ipython_backend2gui(( 文件中 "/usr/local/lib/python3.7/site-packages/matplotlib/backend_bases.py", 1609号线,_fix_ipython_backend2gui ip = IPython.get_ipython(( 文件 "/usr/local/lib/python3.7/site-packages/IPython/core/getipython.py", 22号线,get_ipython 从 IPython.core.interactiveshell import InteractiveShell File "/usr/local/lib/python3.7/site-packages/IPython/core/interactiveshell.py", 第 46 行,在 从 IPython.core.debugger 导入 Pdb 导入错误:无法从"IPython.core.debugger"导入名称"Pdb" (/usr/local/lib/python3.7/site-packages/IPython/core/debugger.py(

我在Mac OS 10.14.6中使用Python 3.7.4和Anaconda

我的免费点数如下:

appnope==0.1.0
attrs==19.3.0
backcall==0.1.0
bleach==3.1.0
cycler==0.10.0
decorator==4.4.0
defusedxml==0.6.0
entrypoints==0.3
importlib-metadata==0.23
ipdb==0.12.2
ipykernel==5.1.2
ipython==7.8.0
ipython-genutils==0.2.0
jedi==0.15.1
Jinja2==2.10.3
json5==0.8.5
jsonschema==3.1.1
jupyter-client==5.3.4
jupyter-core==4.6.0
jupyterlab==1.1.4
jupyterlab-server==1.0.6
kiwisolver==1.1.0
MarkupSafe==1.1.1
matplotlib==3.1.1
mistune==0.8.4
more-itertools==7.2.0
nbconvert==5.6.0
nbformat==4.4.0
notebook==6.0.1
numpy==1.17.2
pandas==0.25.1
pandocfilters==1.4.2
parso==0.5.1
pexpect==4.7.0
pickleshare==0.7.5
prometheus-client==0.7.1
prompt-toolkit==2.0.10
ptyprocess==0.6.0
Pygments==2.4.2
pyparsing==2.4.2
pyrsistent==0.15.4
python-dateutil==2.8.0
pytz==2019.3
pyzmq==18.1.0
Send2Trash==1.5.0
six==1.12.0
terminado==0.8.2
testpath==0.4.2
tornado==6.0.3
traitlets==4.3.3
wcwidth==0.1.7
webencodings==0.5.1
zipp==0.6.0

如果有人能帮忙,我会很高兴

谢谢

删除文件夹中的文件code.py。它会导致冲突。

最新更新