TensorFlow and Replit

Even after upgrading to a paid account on Replit, TensorFlow will not install. Can I just submit a link to my Github code for my machine learning projects or do I need to submit a link to a Replit project?
Has anyone ever gotten TensorFlow to install on Replit? I’ve lots of links to questions about the same issue I’m having but I have never found anyone that posted a solution.
Has anyone at freeCodeCamp tried to run a machine learning model on Replit recently?

Welcome there,

Have you tried the suggestion given here: https://replit.com/talk/ask/To-use-TensorFlow-in-Replit-run-pip-in/20684/517663

To use TensorFlow in Replit, run pip install tensorflow-cpu in the shell, then create a .replit file and in it, put:

run="python main.py"

[packager]
ignoredPackages=["tensorflow"]

Now you can use import tensorflow as tf

The Replit VM has no GPU, so you have to install tensrflow-cpu, which has CPU-only support.
When you install tensorflow-cpu, if you use import tensorflow , python imports tensorflow-cpu. Replit doesn’t know that, so when you import tensorflow it will automatically install normal tensorflow. By adding tensorflow to ignoredPackages, Replit won’t install normal tensorflow.

Hope this helps

2 Likes

This helped for me!
Thanks a lot

Isn’t working for me (I am subscribed at replit). I contacted them and they told me they don’t support tensorflow at this time.

Installing collected packages: tensorflow
ERROR: Could not install packages due to an EnvironmentError: [Errno 122] Disk quota exceeded: ‘/opt/virtualenvs/python3/lib/python3.8/site-packages/tensorflow/libtensorflow_framework.so.2’

I ran ‘pip install tensorflow-cpu’ in the shell.

/rock-paper-scissors-1$ pip install tensorflow-cpu
Requirement already satisfied: tensorflow-cpu in

My .replit file:

language = “python3”
run = “python main.py”

[packager]
ignoredPackages=[“tensorflow”]

Such a shame.

-edit-

It works now after I upgraded to the latest version of pip with:

pip install --upgrade pip

Thank you this worked for me