Removing conda references from PyTorch Docs (#152702)

Addresses #148339

Pull Request resolved: https://github.com/pytorch/pytorch/pull/152702
Approved by: https://github.com/svekars, https://github.com/albanD, https://github.com/atalman
This commit is contained in:
Anita Katahoire
2025-05-20 20:33:28 +00:00
committed by PyTorch MergeBot
parent 05bc78e64f
commit 996c4d803d
6 changed files with 18 additions and 68 deletions

View File

@ -11,14 +11,6 @@ jobs, but it also allows them to be cached properly to improve CI
reliability. reliability.
The list of support files are as follows: The list of support files are as follows:
* Conda:
* conda-env-iOS. This is used by iOS build and test jobs to setup the
conda environment
* conda-env-macOS-ARM64. This is used by MacOS (m1, arm64) build and
test jobs to setup the conda environment
* conda-env-Linux-X64. This is used by Linux buck build and test jobs
to setup the conda environment
* Pip: * Pip:
* pip-requirements-iOS.txt. This is used by iOS build and test jobs to * pip-requirements-iOS.txt. This is used by iOS build and test jobs to
setup the pip environment setup the pip environment

View File

@ -112,8 +112,7 @@ source venv/bin/activate # or `& .\venv\Scripts\Activate.ps1` on Windows
lazy.) lazy.)
```bash ```bash
conda uninstall pytorch -y pip uninstall torch
yes | pip uninstall torch
``` ```
Next run `python setup.py clean`. After that, you can install in `develop` mode again. Next run `python setup.py clean`. After that, you can install in `develop` mode again.
@ -180,14 +179,6 @@ You can use this script to check out a new nightly branch with the following:
source venv/bin/activate # or `& .\venv\Scripts\Activate.ps1` on Windows source venv/bin/activate # or `& .\venv\Scripts\Activate.ps1` on Windows
``` ```
Or if you would like to re-use an existing conda environment, you can pass in
the prefix argument (`--prefix`):
```bash
./tools/nightly.py checkout -b my-nightly-branch -p my-env
source my-env/bin/activate # or `& .\my-env\Scripts\Activate.ps1` on Windows
```
To install the nightly binaries built with CUDA, you can pass in the flag `--cuda`: To install the nightly binaries built with CUDA, you can pass in the flag `--cuda`:
```bash ```bash
@ -289,7 +280,7 @@ dependencies as well as the nightly binaries into the repo directory.
### Python Unit Testing ### Python Unit Testing
**Prerequisites**: **Prerequisites**:
The following packages should be installed with either `conda` or `pip`: The following packages should be installed with `pip`:
- `expecttest` and `hypothesis` - required to run tests - `expecttest` and `hypothesis` - required to run tests
- `mypy` - recommended for linting - `mypy` - recommended for linting
- `pytest` - recommended to run tests more selectively - `pytest` - recommended to run tests more selectively
@ -497,8 +488,7 @@ pip install -r requirements.txt
# Or if you prefer an uncontaminated global executable environment or do not want to go through the node configuration: # Or if you prefer an uncontaminated global executable environment or do not want to go through the node configuration:
# npm install katex && export PATH="$PATH:$(pwd)/node_modules/.bin" # npm install katex && export PATH="$PATH:$(pwd)/node_modules/.bin"
``` ```
> Note: if you installed `nodejs` with a different package manager (e.g., > Note: if you installed `nodejs` with a different package manager then `npm` will probably install a version of `katex` that is not
`conda`) then `npm` will probably install a version of `katex` that is not
compatible with your version of `nodejs` and doc builds will fail. compatible with your version of `nodejs` and doc builds will fail.
A combination of versions that is known to work is `node@6.13.1` and A combination of versions that is known to work is `node@6.13.1` and
`katex@0.13.18`. To install the latter with `npm` you can run `katex@0.13.18`. To install the latter with `npm` you can run
@ -670,13 +660,13 @@ you run `import torch` anywhere else, the development version will be
used). used).
If you want to manage multiple builds of PyTorch, you can make use of If you want to manage multiple builds of PyTorch, you can make use of
[conda environments](https://conda.io/docs/using/envs.html) to maintain [venv environments](https://docs.python.org/3/library/venv.html) to maintain
separate Python package environments, each of which can be tied to a separate Python package environments, each of which can be tied to a
specific build of PyTorch. To set one up: specific build of PyTorch. To set one up:
```bash ```bash
conda create -n pytorch-myfeature python -m venv pytorch-myfeature
source activate pytorch-myfeature source pytorch-myfeature/bin/activate # or `& .\pytorch-myfeature\Scripts\Activate.ps1` on Windows
# if you run python now, torch will NOT be installed # if you run python now, torch will NOT be installed
python setup.py develop python setup.py develop
``` ```
@ -754,7 +744,6 @@ same. Using ccache in a situation like this is a real time-saver.
Before building pytorch, install ccache from your package manager of choice: Before building pytorch, install ccache from your package manager of choice:
```bash ```bash
conda install ccache -c conda-forge
sudo apt install ccache sudo apt install ccache
sudo yum install ccache sudo yum install ccache
brew install ccache brew install ccache
@ -1046,8 +1035,7 @@ than Linux, which are worth keeping in mind when fixing these problems.
3. If you have a Windows box (we have a few on EC2 which you can request access to) and 3. If you have a Windows box (we have a few on EC2 which you can request access to) and
you want to run the build, the easiest way is to just run `.ci/pytorch/win-build.sh`. you want to run the build, the easiest way is to just run `.ci/pytorch/win-build.sh`.
If you need to rebuild, run `REBUILD=1 .ci/pytorch/win-build.sh` (this will avoid If you need to rebuild, run `REBUILD=1 .ci/pytorch/win-build.sh`.
blowing away your Conda environment.)
Even if you don't know anything about MSVC, you can use cmake to build simple programs on Even if you don't know anything about MSVC, you can use cmake to build simple programs on
Windows; this can be helpful if you want to learn more about some peculiar linking behavior Windows; this can be helpful if you want to learn more about some peculiar linking behavior
@ -1264,7 +1252,7 @@ in the meantime there will be some separation.
There are a few "unusual" directories which, for historical reasons, There are a few "unusual" directories which, for historical reasons,
are Caffe2/PyTorch specific. Here they are: are Caffe2/PyTorch specific. Here they are:
- `CMakeLists.txt`, `Makefile`, `binaries`, `cmake`, `conda`, `modules`, - `CMakeLists.txt`, `Makefile`, `binaries`, `cmake`, `modules`,
`scripts` are Caffe2-specific. Don't put PyTorch code in them without `scripts` are Caffe2-specific. Don't put PyTorch code in them without
extra coordination. extra coordination.

View File

@ -8,7 +8,7 @@ It also provides mechanisms to compare PyTorch with other frameworks.
Make sure you're on a machine with CUDA, torchvision, and pytorch installed. Install in the following order: Make sure you're on a machine with CUDA, torchvision, and pytorch installed. Install in the following order:
``` ```
# Install torchvision. It comes with the pytorch stable release binary # Install torchvision. It comes with the pytorch stable release binary
conda install pytorch torchvision -c pytorch pip3 install torch torchvision
# Install the latest pytorch master from source. # Install the latest pytorch master from source.
# It should supersede the installation from the release binary. # It should supersede the installation from the release binary.

View File

@ -92,7 +92,7 @@ We can now run the following commands to build the application from within the
cmake --build . --config Release cmake --build . --config Release
where ``/absolute/path/to/libtorch`` should be the absolute (!) path to the unzipped LibTorch where ``/absolute/path/to/libtorch`` should be the absolute (!) path to the unzipped LibTorch
distribution. If PyTorch was installed via conda or pip, `CMAKE_PREFIX_PATH` can be queried distribution. If PyTorch was installed via pip, `CMAKE_PREFIX_PATH` can be queried
using `torch.utils.cmake_prefix_path` variable. In that case CMake configuration step would look something like follows: using `torch.utils.cmake_prefix_path` variable. In that case CMake configuration step would look something like follows:
.. code-block:: sh .. code-block:: sh

View File

@ -105,8 +105,6 @@ Package not found in win-32 channel.
- pytorch - pytorch
Current channels: Current channels:
- https://conda.anaconda.org/pytorch/win-32
- https://conda.anaconda.org/pytorch/noarch
- https://repo.continuum.io/pkgs/main/win-32 - https://repo.continuum.io/pkgs/main/win-32
- https://repo.continuum.io/pkgs/main/noarch - https://repo.continuum.io/pkgs/main/noarch
- https://repo.continuum.io/pkgs/free/win-32 - https://repo.continuum.io/pkgs/free/win-32
@ -132,17 +130,8 @@ Import error
ImportError: DLL load failed: The specified module could not be found. ImportError: DLL load failed: The specified module could not be found.
The problem is caused by the missing of the essential files. Actually, The problem is caused by the missing of the essential files.
we include almost all the essential files that PyTorch need for the conda For the wheels package, since we didn't pack some libraries and VS2017
package except VC2017 redistributable and some mkl libraries.
You can resolve this by typing the following command.
.. code-block:: bat
conda install -c peterjc123 vc vs2017_runtime
conda install mkl_fft intel_openmp numpy mkl
As for the wheels package, since we didn't pack some libraries and VS2017
redistributable files in, please make sure you install them manually. redistributable files in, please make sure you install them manually.
The `VS 2017 redistributable installer The `VS 2017 redistributable installer
<https://aka.ms/vs/15/release/VC_redist.x64.exe>`_ can be downloaded. <https://aka.ms/vs/15/release/VC_redist.x64.exe>`_ can be downloaded.
@ -153,24 +142,6 @@ uses MKL instead of OpenBLAS. You may type in the following command.
pip install numpy mkl intel-openmp mkl_fft pip install numpy mkl intel-openmp mkl_fft
Another possible cause may be you are using GPU version without NVIDIA
graphics cards. Please replace your GPU package with the CPU one.
.. code-block:: python
from torch._C import *
ImportError: DLL load failed: The operating system cannot run %1.
This is actually an upstream issue of Anaconda. When you initialize your
environment with conda-forge channel, this issue will emerge. You may fix
the intel-openmp libraries through this command.
.. code-block:: bat
conda install -c defaults intel-openmp -f
Usage (multiprocessing) Usage (multiprocessing)
------------------------------------------------------- -------------------------------------------------------

View File

@ -51,19 +51,18 @@ We may eventually upstream them into PyTorch itself along with `functorch`.
We have to install a nightly build of PyTorch so first set up an environment: We have to install a nightly build of PyTorch so first set up an environment:
```sh ```sh
conda create --name dim python -m venv dim
conda activate dim source dim/bin/activate # or `& .\dim\Scripts\Activate.ps1` on Windows
``` ```
First-class dims requires a fairly recent nightly build of PyTorch so that functorch will work. You can install it using one of these commands: First-class dims requires a fairly recent nightly build of PyTorch so that functorch will work. You can install it using one of these commands:
```sh ```sh
# For CUDA 10.2 # For CUDA
conda install pytorch torchvision torchaudio cudatoolkit=10.2 -c pytorch-nightly pip3 install torch torchvision torchaudio --index-url https://download.pytorch.org/whl/nightly/cu116
# For CUDA 11.3
conda install pytorch torchvision torchaudio cudatoolkit=11.3 -c pytorch-nightly
# For CPU-only build # For CPU-only build
conda install pytorch torchvision torchaudio cpuonly -c pytorch-nightly pip3 install torch torchvision torchaudio --index-url https://download.pytorch.org/whl/cpu
``` ```
Install dim. You will be asked for github credentials to access the fairinternal organization. Install dim. You will be asked for github credentials to access the fairinternal organization.