Can you help clarify what goes on in virtual environments and jupyter notebooks?
I created a virtual environment in the Windows Command Prompt. Then I launched the jupyter notebook from Command Prompt as well. It opens in my browser at a localhost URL. First issue: the notebook doesn't seem to use the virtual environment I created. How do I verify the environment and switch it?
I tried to install a library within the notebook. I did %pip install matplotlib. The first line of the output was Defaulting to user installation because normal site packages is not writeable. It finished installing the package, then I imported matplotlib.pyplot. After some searching to see if it installed in the environment or somewhere else, I typed
matplotlib.__version__
matplotlib.__file__
It's in C:\Users\me\AppData\Roaming\Python\Python312\site-packages\matplotlib\__init__.py. However the project directory and associated files are on my desktop. By creating the environment in the command prompt and then launching the notebook, I thought libraries would install in the environment. That doesn't seem to be the case. How do I make sure libraries are installed in the virtual environment?
Another thing: what is happening in the Command Prompt window while the notebook is open in the browser? The Command Prompt doesn't have the arrow (>) or file path at the beginning of the line. I can't type anything (e.g., quit, end, close) in the Command Prompt either to get back to the arrow (>) or file path.
When I was done with the notebook, I saved and closed it, then logged out of jupyter. That didn't return the Command Prompt to normal. What's the proper way to end a session with the notebook in the browser and how do I get the Command Prompt back to normal?