Using Python Jupyter notebooks to work in an environment I've created. Everything went fine until I decided to add another package to the environment. After setting up the environment, I was unable to import additional packages I installed in the environment. I was only able to import packages I installed on set-up.
Here are the commands I used to create the environment initially:
python -m venv test
. test/bin/activate
pip install pyodbc
deactivate
python3 -m ipykernel install --user --name test
This all worked fine. I started a notebook using the new environment and was able to import pyodbc without error! Then I decided I wanted to add another package, geopandas.
. test/bin/activate
pip install geopandas
deactivate
I opened a notebook in the kernel and tried
import geopandas
ModuleNotFoundError Traceback (most recent call last)
/tmp/ipykernel_47903/1529612126.py in <module>
----> 1 import geopandas
ModuleNotFoundError: No module named 'geopandas'
I then attempted linking it to ipykernel again
python3 -m ipykernel install --user --name test
But I still received the same error in the notebook and was unable to import the package. How can I add more packages to an environment after already establishing it? I'm not sure what I'm doing wrong. Thank you!