Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

General Process

Code Block
[]$ module purge
[]$ module load miniconda3/24.3.0
[]$ conda create -p 2.16 python=3.11
[]$ conda activate /cluster/medbow/project/<project-name>/software/tensorflow/2.16
(/cluster/medbow/project/<project-name>/software/tensorflow/2.16) []$ export PYTHONUSERBASE=$CONDA_PREFIX
(/cluster/medbow/project/<project-name>/software/tensorflow/2.16) []$ echo $PYTHONUSERBASE
/cluster/medbow/project/<project-name>/software/tensorflow/2.16
(/cluster/medbow/project/<project-name>/software/tensorflow/2.16) []$ pip install tensorflow
(/cluster/medbow/project/<project-name>/software/tensorflow/2.16) []$ python --version
Python 3.11.9

(/cluster/medbow/project/<project-name>/software/tensorflow/2.16) []$ python ~/tf_test.py
...
TensorFlow Version: 2.16.1
tf.Tensor(997.42975, shape=(), dtype=float32)
(/cluster/medbow/project/<project-name>/software/tensorflow/2.16) []$ conda deactivate
[salexan5@mblog2 tensorflow]$ 
Expand
titletf_test.py
Code Block
import tensorflow as tf
print("TensorFlow Version: " + str( tf.__version__))
print(tf.reduce_sum(tf.random.normal([1000, 1000])))

...

Info

Since we set export PYTHONUSERBASE=$CONDA_PREFIX there is nothing within the home folder under: .local/lib/ i.e. no Python3.11 folder:

Code Block
[salexan5@mblog1 ~]$ ls .local/lib/
python3.10  python3.12

...

Assume the user user02 is part of the <project-name> project.

Code Block
[user02@mblog2user02@mblog1 ~]$ module load miniconda3/24.3.0
[user02@mblog2user02@mblog1 ~]$ conda activate /project/<project-name>/software/tensorflow/2.16/
(/project/<project-name>/software/tensorflow/2.16) [user02@mblog2 ~]$ python -c "import tensorflow as tf; print(\"TensorFlow Version: \" + str( tf.__version__))"
...
TensorFlow Version: 2.16.1
(/project/<project-name>/software/tensorflow/2.16) [user02@mblog2 ~]$ conda deactivate
[user02@mblog2user02@mblog1 ~]$ 
Note
  • Since any one who is part of this project can also access/activate this environment, they can update and modify it.

  • There changes will affect everyone else!

...