Module Not Found Error : 'NLTK' module

This issue remains in this case: I am running in a conda env; but you can see here that the python running is looking elsewhere. this base location doesn’t have nltk installed.

  1. where my python is: /Users/<username>/opt/anaconda3/envs/tstcvs/bin/python
  2. The error sites a diff location
2022-12-23 10:03:08.152 Uncaught app exception
Traceback (most recent call last):
  File "/opt/lib/python3.9/site-packages/streamlit/runtime/scriptrunner/script_runner.py", line 565, in _run_script
    exec(code, module.__dict__)
  File "/Users/<username>/work/dashboard.py", line 15, in <module>
    from embeddings import embed_txt, get_top_k_hits
  File "/Users/<username>/work/embeddings.py", line 11, in <module>
    import nltk
ModuleNotFoundError: No module named 'nltk'

so when I do: streamlit run dashboard... how do I tell streamlit to use the version of python in the active current env? – if this needs to be its own ‘question’ let me know.

I tried what is suggested here, but because streamlit is not using the conda env the suggestion still doesn’t work for my case see link