Tensorflow and torch not found

I installed lambdastack on fresh Ubuntu 22.04 following the instructions here: Lambda Stack: an AI software stack that's always up-to-date

I.e. I ran
wget -nv -O- https://lambdalabs.com/install-lambda-stack.sh | sh -
sudo reboot

After reboot python3 wasn’t able to import tensorflow or torch. So I reinstalled following instructions here:
https://support.lambdalabs.com/hc/en-us/articles/9060760997005-Remove-and-reinstall-Lambda-Stack

After reboot still no dice. This is my output:

~$ python3
Python 3.10.9 (main, Jan 11 2023, 15:21:40) [GCC 11.2.0] on linux
Type “help”, “copyright”, “credits” or “license” for more information.

import tensorflow as tf
Traceback (most recent call last):
File “”, line 1, in
ModuleNotFoundError: No module named ‘tensorflow’
import torch
Traceback (most recent call last):
File “”, line 1, in
ModuleNotFoundError: No module named ‘torch’

I can see tensorflow and torch in /usr/lib/python3/dist-packages.

How can I resolve this issue?

A common issue is if other things are installed in ~/.local or /usr/local
doing the following would likely provide the information of what is seen:
$ pip -v list | egrep “torch|tensorflow”

So if you are inside a virtual environment (Anaconda or python venv) it would ‘hide’ the system installed packages.

To version you CUDA you can use a virtual environment or docker container.
I have a number of examples at:

We should have better write up soon at ‘http://docs.lambdalabs.com/’