In the process of working today, you encounter the problem of installing Anaconda using Conda to create a virtual environment, but after starting Jupyter notebook, you cannot find Python kernel in the virtual environment. Later on the internet found a solution, as follows:
Create a virtual environment
First look at the commands that created the virtual environment at that time:
conda create -n rqalpha python=3.5
Use this command to create a rqalpha
virtual environment called.
Jupyter Notebook Add python kernel
C:\Users\yinzm\AppData\Roaming\jupyter\kernels\
Create a folder below, it is best to use the name of the virtual environment, easy to identify. Then create a Kernel.json file under the folder with the following file contents:
{ "language": "python", "display_name": "rqalpha", "argv": [ "D:\\Anaconda3\\envs\\rqalpha\\python.exe", "-m", "ipykernel_launcher", "-f", "{connection_file}" ]}
Save, restart Jupyter notebook.
After restarting, it was found that there was a rqalpha kernel, but the kernel was never started. Later found to be a lack of ipykernel. Then use the following command to install:
conda install -n rqalpha ipykernel
So far, the problem has been solved.
If you often need to use jupyter notebook, it is best to install the Ipykernel when creating the virtual environment, the command is as follows:
conda create -n rqalpha python=3.5 ipykernel
Reference
- Http://www.jianshu.com/p/f70ea020e6f9
Jupyter Notebook adding Python kernel for anaconda virtual environments