current position:Home>[Conda] python data analysis/deep learning environment configuration windows+conda+jupyter+pytorch

[Conda] python data analysis/deep learning environment configuration windows+conda+jupyter+pytorch

2022-08-06 06:32:12little girl

Install conda

  1. Enter conda official website: https://www.anaconda.com/
    insert image description here
  2. Click to download
  3. Double-click to open the file after the download is complete, the result is as shown:
    insert image description here
  4. Continue to click OK, this section is checked to add environment variables.(There is no problem with checking this option at present, but I added it to the environment variable after the province)
    Insert image description here
  5. Installation completeinsert image description here
  6. Check if the installation is successful: search for cmd in the lower left corner of windows
    insert image description here
    Open, enter conda, the following results appear indicating that the installation is successful.
    insert image description here

Create environment

  1. Create an environment named tutorial and specify the python version as 3.6
    conda create -n tutorial python=3.6
    Created successfully: insert image description here

Activate Environment

  1. Activate environment tutorial
    conda activate tutorial
    Successful activation:
    insert image description here

Install jupyter notebook

  1. Install
    conda install jupyter
  2. Enter jupyter notebook
    jupyter notebook
    insert image description here

Install pytorch

  1. Enter pytorch official website: https://pytorch.org/
  2. Select the desired version and copy the download command
    insert image description here
  3. In cmd, enter the command you just copied in the environment where pytorch needs to be installed.I am here to install the cpu version as an example:
    conda install pytorch torchvision torchaudio cpuonly -c pytorch
  4. Check if the installation is successful:
    import torchtorch.__version__
    The result is as shown:
    insert image description here

Replace mirror source (if needed)

  1. Create a condarc file:
    conda config --add channels r
  2. The file location should be /home/user/.condarc
  3. Find the file, open it, the content of the file should be:
    insert image description here
  4. Replace the contents of the file with the following:
    channels:- defaultsshow_channel_urls: truechannel_alias: https://mirrors.tuna.tsinghua.edu.cn/anacondadefault_channels:- https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main- https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free- https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/r- https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/pro- https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/msys2custom_channels:conda-forge: https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloudmsys2: https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloudbioconda: https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloudmenpo: https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloudpytorch: https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloudsimpleitk: https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud
    insert image description here

copyright notice
author[little girl],Please bring the original link to reprint, thank you.
https://en.pythonmana.com/2022/218/202208060519291396.html

Random recommended