PyTorch的安装与使用示例详解

  $ conda create -n pytorch python=3.9

  Retrieving notices: ...working... done

  Collecting package metadata (current_repodata.json): done

  Solving environment: done

  ==> WARNING: A newer version of conda exists. <==

  current version: 23.1.0

  latest version: 24.4.0

  Please update conda by running

  $ conda update -n base -c defaults conda

  Or to minimize the number of packages updated during conda update use

  conda install conda=24.4.0

  ## Package Plan ##

  environment location: /home/dechin/anaconda3/envs/pytorch

  added / updated specs:

  - python=3.9

  The following packages will be downloaded:

  package | build

  ---------------------------|-----------------

  ca-certificates-2024.3.11 | h06a4308_0 127 KB https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main

  libffi-3.4.4 | h6a678d5_1 141 KB https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main

  openssl-3.0.13 | h7f8727e_1 5.2 MB https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main

  pip-23.3.1 | py39h06a4308_0 2.6 MB https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main

  python-3.9.19 | h955ad1f_1 25.1 MB https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main

  setuptools-69.5.1 | py39h06a4308_0 1003 KB https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main

  sqlite-3.45.3 | h5eee18b_0 1.2 MB https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main

  tk-8.6.14 | h39e8969_0 3.4 MB https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main

  tzdata-2024a | h04d1e81_0 116 KB https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main

  wheel-0.43.0 | py39h06a4308_0 109 KB https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main

  xz-5.4.6 | h5eee18b_1 643 KB https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main

  zlib-1.2.13 | h5eee18b_1 111 KB https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main

  ------------------------------------------------------------

  Total: 39.8 MB

  The following NEW packages will be INSTALLED:

  _libgcc_mutex anaconda/pkgs/main/linux-64::_libgcc_mutex-0.1-main

  _openmp_mutex anaconda/pkgs/main/linux-64::_openmp_mutex-5.1-1_gnu

  ca-certificates anaconda/pkgs/main/linux-64::ca-certificates-2024.3.11-h06a4308_0

  ld_impl_linux-64 anaconda/pkgs/main/linux-64::ld_impl_linux-64-2.38-h2181459_1

  libffi anaconda/pkgs/main/linux-64::libffi-3.4.4-h6a678d5_1

  libgcc-ng anaconda/pkgs/main/linux-64::libgcc-ng-11.2.0-h2234567_1

  libgomp anaconda/pkgs/main/linux-64::libgomp-11.2.0-h2234567_1

  libstdcxx-ng anaconda/pkgs/main/linux-64::libstdcxx-ng-11.2.0-h2234567_1

  ncurses anaconda/pkgs/main/linux-64::ncurses-6.4-h6a678d5_0

  openssl anaconda/pkgs/main/linux-64::openssl-3.0.13-h7f8727e_1

  pip anaconda/pkgs/main/linux-64::pip-23.3.1-py39h06a4308_0

  python anaconda/pkgs/main/linux-64::python-3.9.19-h955ad1f_1

  readline anaconda/pkgs/main/linux-64::readline-8.2-h5eee18b_0

  setuptools anaconda/pkgs/main/linux-64::setuptools-69.5.1-py39h06a4308_0

  sqlite anaconda/pkgs/main/linux-64::sqlite-3.45.3-h5eee18b_0

  tk anaconda/pkgs/main/linux-64::tk-8.6.14-h39e8969_0

  tzdata anaconda/pkgs/main/noarch::tzdata-2024a-h04d1e81_0

  wheel anaconda/pkgs/main/linux-64::wheel-0.43.0-py39h06a4308_0

  xz anaconda/pkgs/main/linux-64::xz-5.4.6-h5eee18b_1

  zlib anaconda/pkgs/main/linux-64::zlib-1.2.13-h5eee18b_1

  Proceed ([y]/n)? y

  Downloading and Extracting Packages

  Preparing transaction: done

  Verifying transaction: done

  Executing transaction: done

  #

  # To activate this environment, use

  #

  # $ conda activate pytorch

  #

  # To deactivate an active environment, use

  #

  # $ conda deactivate