Type “conda activate m2K_ml” (which is an environment I have previously created)
Type “jupyter notebook”
The jupyter notebook opens but what I see are the folders found in the base environment as opposed to the environment I activated.
Is this a normal behaviour?
I thought the point of opening the jupyter notebook from within the environment I created was that, among other things, the jupyter notebook would open in that environment…
Good day @Erik! Thanks for using the Anaconda Community
I think the confusion may come as when you are creating the environments, it will take care of that in the “correct” location for the environments to be stored. Environments can be used by many notebooks / projects at the same time hence keeping them separate like this is useful.
But when you type jupyter notebook it is looking at the current working directory of the Anaconda prompt that you are working in, and opening the Jupyter notebook there.
I haven’t used windows in a while, but I think you can navigate to the folder that contains the files you want to work on, and right click → open Anaconda Prompt. Then running jupyter notebook should give you access to those files.
Alternatively in the terminal use cd to navigate to the folder you want and then run the jupyter notebook command. This Stackoverflow post from a while back has some more permanent solutions to this problem if it would be useful.
Thanks for taking the time to help me with my question.
I am new to Anaconda and Python and based on your answer, the Stackoverflow post you included and some more research, I have found the problem and a solution.
I thought typing “conda activate m2k_ml” (m2k_ml being the name of the environment) would set the working directory to the folder where m2k_ml is found.
I now realize it does not and I have to change the directory to the folder location by typing c:
and then
cd my/environment/folder/path/m2k_ml
Then, I can run “jupyter notebook” and the notebook opens in the correct location i.e. my m2K_ml environment
But this raises the following question:
What’s the point of the “conda activate m2K_ml” command?