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/__init__.py)

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

matplotlib==3.5.0
numpy==1.21.5
pandas==1.3.5
scikit_learn==1.0.2
streamlit==1.5.0
tensorflow==2.2.0rc1
tensorflow_probability==0.8.0rc0
click==8.0.4

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
Kanak

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 : https://share.streamlit.io/adhok/streamlit_ames_housing_price_prediction_app/main . 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,
Pradeep

Looks great @Adhokshaja_Pradeep :+1:t2:

1 Like

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.