PermissionError: This app has encountered an error

app link:
github link: GitHub - adityajadhavab/model

PermissionError: This app has encountered an error.

PermissionError: [Errno 13] Permission denied: '/var/folders'

[20:04:22] :arrows_counterclockwise: Updated app!
2023-06-15 20:04:27.376 Uncaught app exception
Traceback (most recent call last):
File β€œ/home/appuser/venv/lib/python3.9/site-packages/joblib/”, line 702, in _check_previous_func_code
File β€œ/home/appuser/venv/lib/python3.9/site-packages/joblib/”, line 266, in get_cached_func_code
with self._open_item(filename, β€˜rb’) as f:
FileNotFoundError: [Errno 2] No such file or directory: β€˜/var/folders/h9/b9hqt5sd69gc_yd08sw3y6tr0000gn/T/joblib/pycaret/internal/pipeline/_full_transform/’

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File β€œ/home/appuser/venv/lib/python3.9/site-packages/streamlit/runtime/scriptrunner/”, line 565, in _run_script
exec(code, module.dict)
File β€œ/app/model/”, line 88, in
File β€œ/app/model/”, line 62, in run
output = predict(model=model, input_df=input_df)
File β€œ/app/model/”, line 12, in predict
predictions_df = predict_model(model, data=input_df)
File β€œ/home/appuser/venv/lib/python3.9/site-packages/pycaret/clustering/”, line 861, in predict_model
return experiment.predict_model(
File β€œ/home/appuser/venv/lib/python3.9/site-packages/pycaret/clustering/”, line 98, in predict_model
return super().predict_model(estimator, data, ml_usecase)
File β€œ/home/appuser/venv/lib/python3.9/site-packages/pycaret/internal/pycaret_experiment/”, line 893, in predict_model
pred = estimator.predict(data)
File β€œ/home/appuser/venv/lib/python3.9/site-packages/sklearn/utils/”, line 113, in
out = lambda *args, **kwargs: self.fn(obj, *args, **kwargs) # noqa
File β€œ/home/appuser/venv/lib/python3.9/site-packages/pycaret/internal/”, line 310, in predict
X, _ = self._memory_full_transform(self, X, None, with_final=False)
File β€œ/home/appuser/venv/lib/python3.9/site-packages/joblib/”, line 594, in call
return self._cached_call(args, kwargs)[0]
File β€œ/home/appuser/venv/lib/python3.9/site-packages/pycaret/internal/”, line 350, in _cached_call
File β€œ/home/appuser/venv/lib/python3.9/site-packages/joblib/”, line 704, in _check_previous_func_code
self._write_func_code(func_code, first_line)
File β€œ/home/appuser/venv/lib/python3.9/site-packages/joblib/”, line 656, in _write_func_code
self.store_backend.store_cached_func_code([func_id], func_code)
File β€œ/home/appuser/venv/lib/python3.9/site-packages/joblib/”, line 254, in store_cached_func_code
File β€œ/home/appuser/venv/lib/python3.9/site-packages/joblib/”, line 351, in create_location
File β€œ/home/appuser/venv/lib/python3.9/site-packages/joblib/”, line 61, in mkdirp
File β€œ/usr/local/lib/python3.9/”, line 215, in makedirs
makedirs(head, exist_ok=exist_ok)
File β€œ/usr/local/lib/python3.9/”, line 215, in makedirs
makedirs(head, exist_ok=exist_ok)
File β€œ/usr/local/lib/python3.9/”, line 215, in makedirs
makedirs(head, exist_ok=exist_ok)
[Previous line repeated 5 more times]
File β€œ/usr/local/lib/python3.9/”, line 225, in makedirs
mkdir(name, mode)
PermissionError: [Errno 13] Permission denied: β€˜/var/folders’

please help

Hi @Aditya_Jadhav

The code for the app seems fine, it may be due to the pickle file of the saved model. Could you share a Jupyter notebook of how you built the model along with the data used to train the model which would help us to reproduce the model and error.

Normally, when I build and deploy an ML model, I would make sure that the library version used to build the model and the version used for deployed apps, should be the same.

Best regards,

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