I'm completely new to Python, and just downloaded Anaconda with a professional license. I then cloned a GitHub repository into PyCharm to work on as my first project.
PyCharm (which I've never used before) fails on the first line of code:
import numpy as np
Traceback (most recent call last):
File "<input>", line 1, in <module>
File "/Applications/PyCharm with Anaconda plugin .app/Contents/plugins/python/helpers/pydev/_pydev_bundle/pydev_import_hook.py", line 21, in do_import
module = self._system_import(name, *args, **kwargs)
ModuleNotFoundError: No module named 'numpy'
My understanding is that Anaconda should have "shipped" with numpy, scipy, and some other key packages. I get that PyCharm isn't finding that somehow, but how do I redirect it? I'm using a Mac and PyCharm 2020.1. Some of the other help pages said to install packages from the "settings" tab or file/default settings, but neither of those buttons exist in this version of the IDE. I also tried installing numpy in the Python console box based on this solution but that didn't work either:
pip3 install numpy
File "<input>", line 1
pip3 install numpy
^
How do I get PyCharm to "find" the software that I supposedly downloaded with Anaconda?
Edit: I managed to open the python interpreter for this project and install numpy with the "+" button, but it still gives this error when I run import numpy as np
:
>>> import numpy as np
Traceback (most recent call last):
File "<input>", line 1, in <module>
File "/Applications/PyCharm with Anaconda plugin .app/Contents/plugins/python/helpers/pydev/_pydev_bundle/pydev_import_hook.py", line 21, in do_import
module = self._system_import(name, *args, **kwargs)
ModuleNotFoundError: No module named 'numpy'
Edit 2: this error went away after restarting PyCharm... I'm surprised that's necessary after installing a package.