Skip to content

Commit 146bbeb

Browse files
authored
Simplify procedure by removing option to install with conda virtual env.
Removed option to install within conda virtual environment. Recommendation to install in venv environment.
1 parent aebf305 commit 146bbeb

File tree

1 file changed

+5
-82
lines changed

1 file changed

+5
-82
lines changed

site/en/install/pip.md

Lines changed: 5 additions & 82 deletions
Original file line numberDiff line numberDiff line change
@@ -193,38 +193,9 @@ The following NVIDIA® software are only required for GPU support.
193193
nvidia-smi
194194
```
195195

196-
### 3. Install Miniconda
197-
198-
You can skip this section if you have already installed `Miniconda` (referred as *option #1* in the next steps) or you prefer to use Python’s built-in `venv` module (referred as *option #2* in the next steps) instead.
199-
200-
[Miniconda](https://docs.conda.io/en/latest/miniconda.html){:.external}
201-
is the recommended approach for installing TensorFlow with GPU support.
202-
It creates a separate environment to avoid changing any installed
203-
software in your system. This is also the easiest way to install the
204-
required software especially for the GPU setup.
205-
206-
Follow the instuctions of the conda user guide to install miniconda
207-
[Miniconda Installation Guide](https://conda.io/projects/conda/en/latest/user-guide/install/linux.html){:.external}.
208-
209-
### 4. Create a virtual environment
210-
211-
* ***Option #1: Miniconda***
212-
213-
Create a new conda environment named `tf` with the following command.
214-
215-
```bash
216-
conda create --name tf python=3.11
217-
```
218-
You can activate and deactivate it with the following commands.
219-
220-
```bash
221-
conda activate tf
222-
conda deactivate
223-
```
224-
225-
* ***Option #2: venv***
196+
### 3. Create a virtual environment with [venv](https://docs.python.org/3/library/venv.html){:.external}
226197

227-
The [venv](https://docs.python.org/3/library/venv.html){:.external} module supports creating lightweight “virtual environments”, each with their own independent set of Python packages installed in their site directories.
198+
The venv module is part of Python’s standard library and is the officially recommended way to create virtual environments.
228199

229200
Navigate to your desired virtual environments directory and create a new venv environment named `tf` with the following command.
230201

@@ -241,7 +212,7 @@ The following NVIDIA® software are only required for GPU support.
241212

242213
Make sure that the virtual environment is activated for the rest of the installation.
243214

244-
### 5. Install TensorFlow
215+
### 4. Install TensorFlow
245216

246217
TensorFlow requires a recent version of pip, so upgrade your pip
247218
installation to be sure you're running the latest version.
@@ -261,58 +232,10 @@ The following NVIDIA® software are only required for GPU support.
261232
262233
Note: Do not install TensorFlow with `conda`. It may not have the latest stable version. `pip` is recommended since TensorFlow is only officially released to PyPI.
263234
264-
### 6. Set environment variables
235+
### 5. Set environment variables
265236
266237
You can skip this section if you only run TensorFlow on the CPU.
267238
268-
* ***Option #1: Miniconda***
269-
270-
Locate the directory for the conda environment in your terminal window by running in the terminal:
271-
`echo $CONDA_PREFIX`
272-
273-
Enter that directory and create these subdirectories and files:
274-
275-
```bash
276-
cd $CONDA_PREFIX
277-
mkdir -p ./etc/conda/activate.d
278-
mkdir -p ./etc/conda/deactivate.d
279-
touch ./etc/conda/activate.d/env_vars.sh
280-
touch ./etc/conda/deactivate.d/env_vars.sh
281-
```
282-
Edit `./etc/conda/activate.d/env_vars.sh` as follows:
283-
284-
```bash
285-
#!/bin/sh
286-
287-
# Store original LD_LIBRARY_PATH
288-
export ORIGINAL_LD_LIBRARY_PATH="${LD_LIBRARY_PATH}"
289-
290-
# Get the CUDNN directory
291-
CUDNN_DIR=$(dirname $(dirname $(python -c "import nvidia.cudnn; print(nvidia.cudnn.__file__)")))
292-
293-
# Set LD_LIBRARY_PATH to include CUDNN directory
294-
export LD_LIBRARY_PATH=$(find ${CUDNN_DIR}/*/lib/ -type d -printf "%p:")${LD_LIBRARY_PATH:+:${LD_LIBRARY_PATH}}
295-
296-
# Get the ptxas directory
297-
PTXAS_DIR=$(dirname $(dirname $(python -c "import nvidia.cuda_nvcc; print(nvidia.cuda_nvcc.__file__)")))
298-
299-
# Set PATH to include the directory containing ptxas
300-
export PATH=$(find ${PTXAS_DIR}/*/bin/ -type d -printf "%p:")${PATH:+:${PATH}}
301-
```
302-
Edit `./etc/conda/deactivate.d/env_vars.sh` as follows:
303-
304-
```bash
305-
#!/bin/sh
306-
307-
# Restore original LD_LIBRARY_PATH
308-
export LD_LIBRARY_PATH="${ORIGINAL_LD_LIBRARY_PATH}"
309-
310-
# Unset environment variables
311-
unset CUDNN_DIR
312-
unset PTXAS_DIR
313-
```
314-
* ***Option #2: venv***
315-
316239
Locate the directory for the venv environment in your terminal window by running in the terminal:
317240
`echo $VIRTUAL_ENV`
318241
@@ -358,7 +281,7 @@ The following NVIDIA® software are only required for GPU support.
358281
}
359282
```
360283
361-
### 7. Verify the installation
284+
### 6. Verify the installation
362285
363286
Verify the CPU setup:
364287

0 commit comments

Comments
 (0)