@ the Author: By Runsen
1. History of Jupyter Notebook
Fernando Perez, founder of Jupyter, said his original dream was to create a computing platform that combined the three scientific computing languages Ju (Julia), Py (Python) and R, so he named it JU-Py-te-R. Up to now, Jupyter has become a multi-functional scientific computing platform that supports almost all languages and can integrate software code, computational output, interpretation documents and multimedia resources together.
In Pycham you can only run a total PY file, while in Jupyter Notebook you can run a single line of code.
2. Environment construction
You can install it directly with the PIP command.
pip install jupyter
Copy the code
You can also download Anaconda
The Anaconda’s official website to download links: www.anaconda.com/distributio…
If the download speed too slow, can choose to install the Anaconda tsinghua image, url mirrors.tuna.tsinghua.edu.cn/anaconda/ar…
After downloading, double-click the installation package to install it. Add tsinghua image source after installation To solve the problem of slow download of conda install, open the Anaconda Prompt command line and add commands one by one
conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free/
conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge/
conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/msys2/
conda config --set show_channel_urls yes
Copy the code
Before said Qinghua source, do not adapt, now OK, can use Qinghua source
3. Conda common commands
Conda not only makes it easy to install, update, and uninstall toolkits, but also automatically installs the corresponding dependency packages during installation. Most of the conda commands are used to configure the virtual environment. The following are common conda commands
conda listConda search request conda install request conda uninstall Request // Delete request conda Update request // Update the request libraryCopy the code
In many cases, different libraries rely on different dependency packages to create a virtual environment. The following is a common command used by conda to create a virtual environment
Conda info --envs // View installed environment # deeplearn generation refers to the name of the cloned new environment, Conda create --name deeplearn --clone Base # Activate envname //for Windows source activate Envname //for liunx and MAC # deactivate # check the package conda listCopy the code
Conda info --envsCopy the code
4. Virtual environment construction
Run the Jupyter Notebook on the created virtual environment, but find that Python in the notebook is not running on the specified virtual environment engine. You only need to install the NB_conda_kernels plug-in to solve the problem. Note that the installation is in the Base environment, not the virtual environment
(base) conda install nb_conda_kernels
Copy the code
After the installation, switch to the specified virtual environment in kernel -> change kernel
You can set the kernel when creating a new Notebook
5. Change the path for opening the Jupyter Notebook
After installing the Jupyter Notebook, you will open the default file location and need to change the file path.
The following tutorial teaches you to modify the jupyter Notebook open path
Open the location of the Jupyter Notebook file
Right click, open properties
Set parameters based on the following figureThis way, opening the Jupyter Notebook is not the default document location.
6. Difference between PIP and Conda
PIP allows you to install Python packages in any environment, and Conda allows you to install any language packages (including C or Python) in a Conda environment.
Conda uses a new package format, you can’t interchangeably use conda and PIP,
PIP cannot install and parse conda’s package format. You can use both tools, but they are not interactive.
The conda library is installed in one place, and depends on the Python environment and dependent libraries. For example, the numpy version may be too high, resulting in errors when installing the library.
PIP installation depends on the Python version. Sometimes conda cannot be installed. PIP installation can be used instead.
GitHub, portal ~, GitHub, portal ~, GitHub, Portal ~