infinity
infinity

Reputation: 1920

PyCharm Debugging : ModuleNotFoundError: No module named 'numpy'

I am trying to do a step-by-step debugging of a python file (like this) using PyCharm and I am running into the following issue

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'

I am using the following interpreter (in run configuration) that does have numpy installed, but I am still seeing this issue. Any pointers would be super helpful enter image description here

Upvotes: 4

Views: 3294

Answers (1)

geometrikal
geometrikal

Reputation: 3294

I had to go into Run/Debug configurations and uncheck then recheck "Add content roots to PYTHONPATH" and "Add source roots to PYTHONPATH"

Upvotes: 1

Related Questions