Error when importing tensorflow probability

Hi everyone,
I am new to the streamlit app environment.
I am trying to deploy my streamlit app in streamlit-cloud using the deploy app functionality provided on the site. The app deploys , but throws an error while importing tensorflow-probability library . The error is as follows

ImportError: cannot import name 'compiler' from 'tensorflow.python.autograph.pyct' (/home/appuser/venv/lib/python3.7/site-packages/tensorflow/python/autograph/pyct/

This app seems to be working fine on my local machine. The contents of my requirements.txt file are as follows


Should I add another library to mitigate this? Should I change the version of the tensorflow-probability library?
Thank You in Advance !

Hey @Adhokshaja_Pradeep

Welcome to the Streamlit Community :tada: :tada:

I found this solution online for the issue that you are facing.

According to this, you should use the latest version of TensorFlow and Tensorflow_probablity and that should fix the issue.

Hope this helps

Hi @Kanak ,
Thanks for your help! I removed the versions and supplied just the library names to the requirements.txt file. It is working now. Here is the link to the app : . There is still some work that needs to be done from my end to clean up the UI but I would love to get some feedback.
Thanks & Regards,

Looks great @Adhokshaja_Pradeep :+1:t2:

1 Like