Today, I would like to use the conda virtual environment with `` `Jupyter Notebook.
google colaboratory```It comes in handy when dealing with datasets that cannot be taken out to.
--Installation of Anaconda
is complete
-- Jupyter Notebook
has been installed
--Created an existing conda virtual environment (named `<env_name>`
)
--Install the Jupyter Notebook plugin environment_kernels
.
pip install environment_kernels
This time, I installed it in the default `` `baseof the conda virtual environment. The reason is that I want to open it with the operation
Win +" r "->
" Jupyter Notebook "```!
I want to use an existing virtual environment with Jupyter Notebook. However, you need to install Jupyter Notebook in that environment.
I want to keep the existing one if possible, so here
--I decide to clone the virtual environment.
# <env_name>Is an existing conda virtual environment
# <new_env_name>Give the name of the new virtual environment
conda create -n <new_env_name> --clone <env_name>
Install Jupyter Notebook into your virtual environment so that the Jupyter Notebook plugin environment_kernels
will recognize it.
--Switch to the cloned virtual environment.
conda activate <new_env_name>
--Install Jupyter Notebook.
pip install jupyter
--Generate a configuration file
jupyter notebook --generate-config
--Edit the configuration file ――Since I have Windows, I edit it with notepad. --Please change the following \ <user_name > to suit your environment.
notepad C:\Users\<user_name>\.jupyter\jupyter_notebook_config.py
--Add the following two lines to the end of the opened file --Depending on how you installed Anaconda, the path may not be as shown in the example below. Please change accordingly. --There are various ways to specify the Python path, such as changing the delimiter from "" to "\", "/", or r "~". In the following, "" in the window path string is changed to "/". </ font>
c.NotebookApp.kernel_spec_manager_class='environment_kernels.EnvironmentKernelSpecManager'
c.EnvironmentKernelSpecManager.env_dirs=['C:/Users/<user_name>/.conda/envs/']
#The following one line is 2019-12-13 It didn't work now
# c.EnvironmentKernelSpecManager.conda_env_dirs = ['C:/Users/0000112345/.conda/envs/']
--After editing, save and close
--Launch Jupyter Notebook -Confirm that the environment has been switched with "Kernel"-> "Change kernel"
--I overlooked that the target side also needs a Jupyter Notebook to be recognized by the plugin.
I want it to look the same as Google Colaboratory. What should i do? ??