PermissionError: [Errno 13] Permission denied: 'chromedriver_autoinstaller/120'

I am trying to deploy my app, but all on a sudden it went down with below error

Repo: Cricket-Prophet/serve.py at main · sayan1999/Cricket-Prophet · GitHub
App: https://cricket-prophet.streamlit.app/

The error is arising when chromedriver autoinstaller tries to use make dirs, surprisingly enough same piece of code was working earlier until it broke

PermissionError: [Errno 13] Permission denied: '/home/adminuser/venv/lib/python3.9/site-packages/chromedriver_autoinstaller/120'
2023-12-13 15:00:29.199 Uncaught app exception
Traceback (most recent call last):
  File "/home/adminuser/venv/lib/python3.9/site-packages/streamlit/runtime/scriptrunner/script_runner.py", line 534, in _run_script
    exec(code, module.__dict__)
  File "/mount/src/cricket-prophet/serve.py", line 1, in <module>
    from scrape import scrape, get_live_matches
  File "/mount/src/cricket-prophet/scrape.py", line 15, in <module>
    chromedriver_autoinstaller.install()
  File "/home/adminuser/venv/lib/python3.9/site-packages/chromedriver_autoinstaller/__init__.py", line 21, in install
    chromedriver_filepath = utils.download_chromedriver(path, no_ssl)
  File "/home/adminuser/venv/lib/python3.9/site-packages/chromedriver_autoinstaller/utils.py", line 299, in download_chromedriver
    os.makedirs(chromedriver_dir)
  File "/usr/local/lib/python3.9/os.py", line 225, in makedirs
    mkdir(name, mode)
PermissionError: [Errno 13] Permission denied: '/home/adminuser/venv/lib/python3.9/site-packages/chromedriver_autoinstaller/120'

Hi @Sayan_Dey

I suspect that there may have been some update in any of the libraries in the requirements.txt file that may have caused this. Could you try specifying the library version in the requirements.txt file (you may have to experiment and specify version numbers for one or more libraries).

For example, in one of my app that is using chromium and selenium I am using an older version of selenium such as:

selenium==4.11.2

Hope this helps!

Hi @dataprofessor
Appreciate such quick response. I took my time in the meanwhile to deploy it somewhere else (hugginspace streamlit platform) and it actually started working there.

I shall once try out versioning selenium as you specified, but as you see in the error section, do you think any streamlit change might have happened recently which is not letting create folder inside ‘/home/adminuser/venv/lib/python3.9/site-packages/chromedriver_autoinstaller/120’