I am able to run a python code inside a folder as
python mycode.py
without problems (on MacOS).
However, I want to be able to run this code from anywhere else. So I define a small bash (run_my_code) script as follows
cd /path/to/my/folder
echo $PYTHONPATH
echo $PATH
pip list
pwd
python mycode.py
and run it as
run_my_code
which results in an ModuleNotFoundError. I checked and made sure that PYTHONPATH and PATH are the same in both environments. Even pip list list the same list of modules, even the one missing!!
How can I fix this module/path error?
I have answered my own question, but this only seems to be like a bad workaround. There must be a better way to fix this!
click) is not found. But it is listed inpip list!PYTHONPATH. They are the same!