On Ubuntu I have python 3.6.9
I created new project using PyCharm, into project folder there is venv
folder.
When I open venv
folder in terminal and do:
python3
import numpy
It works, no any error.
But when I create some file in that venv
folder using PyCharm, and try in this file:
import numpy
then I get ModuleNotFoundError: No module named 'numpy'
error.
Why can't import module into file? module obviously installed because I can import that using terminal (folder is same for both cases).
What is my mistake ?
Pycharm uses virtual environments for serving modules, so you will have to download the package from either the GUI or by activating the virtual environment in the terminal and then doing the pip install.
if you want to do it from the GUI you can check the official tutorial. (Working and tested)
To do it manually, first to activate the environment in linux go wherever the venv folder is and type
source venv/scripts/activate
(to activate) and then you'll be able to dopip install numpy
. (Not tested but it should work)