- Development Status :: 5 - Production/Stable
- Intended Audience :: Education
- Intended Audience :: Science/Research
- License :: OSI Approved :: BSD License
- Programming Language :: C
- Programming Language :: C++
- Programming Language :: Python
- Programming Language :: Python :: 3
- Programming Language :: Python :: 3.7
- Programming Language :: Python :: 3.8
- Programming Language :: Python :: 3.9
- Topic :: Scientific/Engineering
- Topic :: Scientific/Engineering :: Artificial Intelligence
- Topic :: Scientific/Engineering :: Mathematics
- Topic :: Software Development
- Topic :: Software Development :: Libraries
- Topic :: Software Development :: Libraries :: Python Modules
When you know about this project and you want to new install torch to support your project or you get trouble as ModuleNotFoundError: No module named "torch" or ImportError: cannot import name "torch" in your project, let follow this tutorial to install torch
In Windows (CMD):
py -m pip --version
In Unix/macOS:
python3 -m pip --version
Ensure pip, setuptools, and wheel are up to date:
In Windows (CMD):
py -m pip install --upgrade pip setuptools wheel
In Unix/macOS:
python3 -m pip install --upgrade pip setuptools wheel
Optional - If you want to install
In Windows (CMD):
- Install virtualenv - if you installed it, please ignore
py -m pip install --user virtualenv
- Create a virtual environment
py -m venv test_torch_env
- Active the virtual environment
test_torch_env\Scripts\active
In Unix/macOS:
- Install virtualenv - if you installed it, please ignore
pip3 install virtualenv
- Create a virtual environment
python3 -m venv test_torch_env
- Active the virtual environment
source test_torch_env/bin/active
To install torch on Windows(CMD):
py -m pip install torch
To install torch on Unix/macOs:
pip install torch
Example:
pip install torch==1.0.0
Please see the version list below table:
Version | Released date | Command |
---|---|---|
torch 1.12.1 | 2022-08-05T17:21:05 | Windows: Unix/macOs:
|
torch 1.12.0 | 2022-06-28T16:20:35 | Windows: Unix/macOs:
|
torch 1.11.0 | 2022-03-10T16:37:26 | Windows: Unix/macOs:
|
torch 1.10.2 | 2022-01-27T19:29:53 | Windows: Unix/macOs:
|
torch 1.10.1 | 2021-12-15T21:58:45 | Windows: Unix/macOs:
|
torch 1.10.0 | 2021-10-21T14:45:53 | Windows: Unix/macOs:
|
torch 1.9.1 | 2021-09-20T22:30:00 | Windows: Unix/macOs:
|
torch 1.9.0 | 2021-06-15T15:09:35 | Windows: Unix/macOs:
|
torch 1.8.1 | 2021-03-25T15:54:32 | Windows: Unix/macOs:
|
torch 1.8.0 | 2021-03-04T17:05:59 | Windows: Unix/macOs:
|
torch 1.7.1 | 2020-12-10T16:19:45 | Windows: Unix/macOs:
|
torch 1.7.0 | 2020-10-27T15:49:06 | Windows: Unix/macOs:
|
torch 1.6.0 | 2020-07-28T15:50:50 | Windows: Unix/macOs:
|
torch 1.5.1 | 2020-06-18T16:29:35 | Windows: Unix/macOs:
|
torch 1.5.0 | 2020-04-21T16:01:10 | Windows: Unix/macOs:
|
torch 1.4.0 | 2020-01-15T23:22:37 | Windows: Unix/macOs:
|
torch 1.3.1 | 2019-11-07T17:45:55 | Windows: Unix/macOs:
|
torch 1.3.0.post2 | 2019-10-22T18:06:28 | Windows: Unix/macOs:
|
torch 1.3.0 | 2019-10-10T15:16:45 | Windows: Unix/macOs:
|
torch 1.2.0 | 2019-08-08T16:01:26 | Windows: Unix/macOs:
|
torch 1.1.0.post2 | 2019-06-21T21:47:40 | Windows: Unix/macOs:
|
torch 1.1.0 | 2019-04-30T23:21:02 | Windows: Unix/macOs:
|
torch 1.0.1.post2 | 2019-02-08T19:05:01 | Windows: Unix/macOs:
|
torch 1.0.1 | 2019-02-05T00:38:13 | Windows: Unix/macOs:
|
torch 1.0.0 | 2018-12-07T18:56:01 | Windows: Unix/macOs:
|
Download the distribution file from torch-1.12.1-cp310-none-macosx_11_0_arm64.whl or the specific torch version in the below list of distribution
After that, install by command:
On Windows(CMD):
py -m pip install <path_to_torch_downloaded_file>
On Unix/macOs:
pip install <path_to_torch_downloaded_file>
List distribution:
Project link: