PySpark installation issue on Streamlit Cloud

can any one give me any solution about streamlit deployment error,
basically when I run the streamlit app on local machine its working fine but I when I try to deploye on streamlit cloud its give me error
I pasted the SS of the same below

pyspark needs Java, therefore try to add this to your packages.txt file:


is pacakages.txt file contains same things as requirements.txt file ?

No, the packages.txt file is for binary packages, the requirements.txt is for pip packages.

in requirements.txt I added*


and In packages.txt

still I am getting same Error

One Thing I also Like to mentioned,
I written the pyspark code in jupyter notebook and then save my trained model by using save() method. and same model I exported in the file by using load() for prediction.

is this work on streamlit cloud or I have to write all code in only python ( file ?

I would try some other packages instead, for example:

  • default-jre
  • default-jdk
1 Like

I don’t understand, can you please provide a link to your public github repo?

Thank you soo much Now its work with * default-jre
I spent almost 2 days for fixing this error Thanx allot @Franky1

1 Like

Hi, I am getting the same error when using Pyspark and I have tried all 3 options of default- in packages.txt but still getting same error.

App weblink: AppWebLink
Github Public repo: GithubRepoLink