Jupyter automatically completes and switches virtual environments

The use of Jupyter NoteBook and Jupyter Lab is exactly the same, and Jupyter NoteBook has more functions. This article uses Jupyter NoteBook as an example to illustrate the relevant usage skills

Autocomplete

%config IPCompleter.greedy=True
Enter the above code in the first line of the code, and when it needs to be completed, Tabpress the button to pop up the completed information

switch virtual environment

Anacoda is required to switch virtual environments

  1. conda create -n env_name python=3.10
    new environment
  2. activate env_name
    switch to virtual environment
  3. pip install ipykernel
    Installation package
  4. python -m ipykernel install --user --name 虚拟环境名字 --display-name "虚拟环境名字"
    Add virtual environment to configuration
  5. jupyter notebook \ jupyter lab
    Open jupyter notebook or jupyter lab
  6. Open kernel->change kernelselect your virtual environment
    insert image description here

Guess you like

Origin blog.csdn.net/qq_33880925/article/details/127496041