Search code examples
pythonsqlalchemypipjupyter-notebookpython-venv

ModuleNotFoundError: No module named 'sqlalchemy' after installation in Jupyter Notebook


I have installed sqlalchemy in venv. It works in VSCode but I need to use it in Jupyter Notebook and is not working. When I attempt to install it in the notebook a message is shown saying the requirement has already been satisfied. I have installed flask-sqlalchemy as I saw some people advised but this one is not recognized too. I have also restarted the kernel but it did not work.enter image description here


Solution

  • I was able to finally run it but I had to install ipykernel in the virtual environment:

    python -m pip install ipykernel
    python -m ipykernel install --user