【问题标题】:PyCharm Debugging : ModuleNotFoundError: No module named 'numpy'PyCharm 调试:ModuleNotFoundError:没有名为“numpy”的模块
【发布时间】:2020-01-20 21:57:22
【问题描述】:

我正在尝试使用 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,但我仍然看到这个问题。任何指针都会非常有帮助

【问题讨论】:

  • stackoverflow.com/questions/49097715/… 这可能有帮助吗?
  • 你确定你使用的是安装了numpy的解释器吗?
  • 请检查Run - Edit Configurations中的运行配置是否使用相同的解释器

标签: python debugging pycharm


【解决方案1】:

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

【讨论】:

    猜你喜欢
    • 2021-03-22
    • 2019-03-18
    • 2020-04-21
    • 2020-11-20
    • 2019-01-26
    • 2019-09-25
    • 2018-10-23
    • 1970-01-01
    • 2020-12-24
    相关资源
    最近更新 更多