PyCharm调试:ModuleNotFoundError:没有名为“ numpy”的模块

时间:2019-09-19 20:02:27

标签: python debugging pycharm

我正在尝试使用PyCharm对python文件(例如this)进行逐步调试,并且遇到了以下问题

Connected to pydev debugger (build 181.4892.64)
Traceback (most recent call last):
  File "/Users/aravidas/Library/Application Support/JetBrains/Toolbox/apps/PyCharm-C/ch-0/181.4892.64/PyCharm CE.app/Contents/helpers/pydev/pydevd.py", line 1664, in <module>
    main()
  File "/Users/aravidas/Library/Application Support/JetBrains/Toolbox/apps/PyCharm-C/ch-0/181.4892.64/PyCharm CE.app/Contents/helpers/pydev/pydevd.py", line 1658, in main
    globals = debugger.run(setup['file'], None, None, is_module)
  File "/Users/aravidas/Library/Application Support/JetBrains/Toolbox/apps/PyCharm-C/ch-0/181.4892.64/PyCharm CE.app/Contents/helpers/pydev/pydevd.py", line 1068, in run
    pydev_imports.execfile(file, globals, locals)  # execute the script
  File "/Users/aravidas/Library/Application Support/JetBrains/Toolbox/apps/PyCharm-C/ch-0/181.4892.64/PyCharm CE.app/Contents/helpers/pydev/_pydev_imps/_pydev_execfile.py", line 18, in execfile
    exec(compile(contents+"\n", file, 'exec'), glob, loc)
  File "/Users/aravidas/Documents/Github/yt8m/temp-youtube-8m/train.py", line 20, in <module>
    import eval_util
  File "/Users/aravidas/Documents/Github/yt8m/temp-youtube-8m/eval_util.py", line 15, in <module>
    import average_precision_calculator as ap_calculator
  File "/Users/aravidas/Documents/Github/yt8m/temp-youtube-8m/average_precision_calculator.py", line 57, in <module>
    import numpy
ModuleNotFoundError: No module named 'numpy'

我正在使用以下解释器(在运行配置中),该解释器确实安装了numpy,但仍然看到此问题。任何指针都将非常有帮助 enter image description here

1 个答案:

答案 0 :(得分:0)

我必须进入运行/调试配置,然后取消选中然后重新选中“将内容根添加到PYTHONPATH”和“将源根添加到PYTHONPATH”