Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PermissionError: [Errno 13] Permission denied: /usr/lib/python3.11/site-packages/seleniumbase/drivers/chromedriver_linux64.zip #1926

Closed
carlosal1015 opened this issue Jun 27, 2023 · 8 comments
Labels
question Someone is looking for answers

Comments

@carlosal1015
Copy link

Hi, I would like to use chromedriver over /usr/bin/chromedriver, but if this is not found, we use the command

$ sbase get chromedriver latest

*** chromedriver version for download = 114.0.5735.90 (Latest)

Downloading chromedriver_linux64.zip from:
https://chromedriver.storage.googleapis.com/114.0.5735.90/chromedriver_linux64.zip ...

* Unable to download driver! Retrying in 3s...


*** chromedriver version for download = 114.0.5735.90 (Latest)

Downloading chromedriver_linux64.zip from:
https://chromedriver.storage.googleapis.com/114.0.5735.90/chromedriver_linux64.zip ...
** Unable to download driver! Retrying in 5s...


*** chromedriver version for download = 114.0.5735.90 (Latest)

Downloading chromedriver_linux64.zip from:
https://chromedriver.storage.googleapis.com/114.0.5735.90/chromedriver_linux64.zip ...
Traceback (most recent call last):
  File "/usr/sbin/sbase", line 8, in <module>
    sys.exit(main())
             ^^^^^^
  File "/usr/lib/python3.11/site-packages/seleniumbase/console_scripts/run.py", line 1006, in main
    sb_install.main()
  File "/usr/lib/python3.11/site-packages/seleniumbase/console_scripts/sb_install.py", line 720, in main
    with open(file_path, "wb") as file:
         ^^^^^^^^^^^^^^^^^^^^^
PermissionError: [Errno 13] Permission denied: '/usr/lib/python3.11/site-packages/seleniumbase/drivers/chromedriver_linux64.zip'

I am packaging python-seleniumbase in order to test trame-client.

@mdmintz mdmintz added the question Someone is looking for answers label Jun 27, 2023
@mdmintz
Copy link
Member

mdmintz commented Jun 27, 2023

This looks like your Linux user doesn't have the permissions necessary to access that folder.

There are a few ideas, such as https://stackoverflow.com/a/23871224/7058266

Try with chmod or chown. Or use a user that has access to that folder. (root or other).

Alternatively, you can try manually getting the file, (eg. with wget), and then placing the chromedriver file on your PATH (eg. in /usr/local/bin).

Also, it's possible that the download will succeed if you let the test get it automatically (because the permissions may be different).

@boludoz
Copy link

boludoz commented Mar 6, 2024

I think it is a bug and should be solved, I am using Windows and it didn't happen before.

@boludoz
Copy link

boludoz commented Mar 6, 2024

This does not happen with the normal driver.

@mdmintz
Copy link
Member

mdmintz commented Mar 6, 2024

@boludoz The base algorithm of the SeleniumBase Chromedriver Patcher is unchanged from the undetected-chromedriver version:

https://github.com/ultrafunkamsterdam/undetected-chromedriver/blob/0aa5fbe252370b4cb2b95526add445392cad27ba/undetected_chromedriver/patcher.py#L347

If you have an issue with the Patcher, mention that in the undetected-chromedriver repo.

@boludoz
Copy link

boludoz commented Mar 6, 2024

@boludoz The base algorithm of the SeleniumBase Chromedriver Patcher is unchanged from the undetected-chromedriver version:

https://github.com/ultrafunkamsterdam/undetected-chromedriver/blob/0aa5fbe252370b4cb2b95526add445392cad27ba/undetected_chromedriver/patcher.py#L347

If you have an issue with the Patcher, mention that in the undetected-chromedriver repo.

The problem seems to be that a uc_driver.exe remains open.

@boludoz
Copy link

boludoz commented Mar 6, 2024

ultrafunkamsterdam/undetected-chromedriver#1655

In fact I made some proposals for changes.

@boludoz
Copy link

boludoz commented Mar 6, 2024

I would really like to investigate if it is possible to do this multi-instance but I don't have time.

@mdmintz
Copy link
Member

mdmintz commented Mar 6, 2024

Multithreaded UC Mode without using pytest -n NUM is going to be officially announced in the second UC Mode video tutorial that I'm currently trying to prepare the presentation for. The fewer GitHub notifications I see until then, the faster it gets done.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Someone is looking for answers
Projects
None yet
Development

No branches or pull requests

3 participants