I have a conda environment conda_env, which I activate in a Jupyter notebook on Visual Studio Code. The environment contains packages installed using both conda install and pip install.
The notebook resides in a Unix shell on a remote server. I am able to import packages installed with conda and residing inside the environment path (miniconda/envs/conda_env/...). However, when I try to import packages that were installed with pip, the import fails.
ModuleNotFoundError: No module named 'django-extensions'
I can import the packages if I start a Python environment on the command line inside the conda environment. Below shows the path the package is found in.
import django_extensions
print(django_extensions.__file__)
# ~/.local/lib/python3.9/site-packages/django_extensions/__init__.py
I eventually found a workaround solution by putting this line into the notebook.
sys.path.append("~/.local/lib/python3.9/site-packages/")
My question is, is there a way to do this across the entire VSC, without me having to manually put that line in inside every notebook?
Thank you!