Problem in installing jupyter notebook in tensorflow-gpu conda environment

Hello all,

I am working on centos7 OS workstation. My system has NVIDIA RTX 3090 GPU.
I created a conda environment and installed gpu tensorflow using following sequence of commands:

conda create -n tfgpu python=3.7
conda activate tfgpu
conda install -c conda-forge cudatoolkit=11.2.2 cudnn=8.1.0
mkdir -p $CONDA_PREFIX/etc/conda/activate.d
echo ‘export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$CONDA_PREFIX/lib/’ > $CONDA_PREFIX/etc/conda/activate.d/env_vars.sh

Then I restart the terminal and installed the tensorflow as follows:

conda activate tfgpu
python3 -m pip install tensorflow==2.10

and verify install:

python3 -c “import os; os.environ[‘TF_CPP_MIN_LOG_LEVEL’] = ‘3’; import tensorflow as tf; print('Num GPUs Available: ', len(tf.config.list_physical_devices(‘GPU’)))”

It is recognizing 1 GPU.

After this I tried to install jupyter notebook in same virtual environment using following command, but failed to installed. It is taking days to solve the environment.

conda install -c conda-forge jupyter

I don’t know where I am doing wrong.
How can I install jupyter notebbok in the tensorflow environment? Please guide me.

Thanks

1 Like

Hi @maninder_singh, In the tfgpu environment could you please try to install jupyter notebook using pip install notebook and to open notebook use jupyter notebook. Thank You.

1 Like

@Kiran_Sai_Ramineni , thank you so much, this command works and successfully installed jupyter notebook. I also installed matplotlib and seaborn similarly using pip install matplotlib and pip install seaborn.

Thank mate, this help me a lot!

For any one trying this method I replace this part of the code:
… conda install -c conda-forge cudatoolkit=11.2.2 cudnn=8.1.0
mkdir “%CONDA_PREFIX%\etc\conda\activate.d”
echo ‘export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$CONDA_PREFIX/lib/’ $CONDA_PREFIX/etc/conda/activate.d/env_vars.sh

If any one is looking for other methods I also tried this ones:

  1. Install Tensorflow 2.0 with GPU Support and Jupyter Notebook | by birkan atıcı | Medium
  2. How to make Jupyter Notebook to run on GPU? - Stack Overflow

Make me know more about the process and if you read the comments you’re gonna look that it works for a lot of people :alien: