I am running a python script in Jupyter notebook and it works fine. I converted the notebook to python file and when I try to run it from the terminal I get an error saying
>>> import tensorflow as tf
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
ModuleNotFoundError: No module named 'tensorflow'
I have installed tensorflow and jupyter notebook using conda in a conda environment. I am on Ubuntu 18.04. I am trying to run the python script from within the environment. When I give which python
I get the following output
/usr/bin/python
My limited understanding is that this is probably happening because the script is running on the base python whereas tensorflow is pointing to anaconda installation which base python cannot access. How can I run the script from the terminal?