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

Python cant found Firefox installation path #4

Open
Deslo123 opened this issue Nov 19, 2024 · 9 comments
Open

Python cant found Firefox installation path #4

Deslo123 opened this issue Nov 19, 2024 · 9 comments
Assignees

Comments

@Deslo123
Copy link

for some reason python cant find firefox installation path when i use undetected_geckodriver
it works just fine with "from selenium import webdriver" command i add my code and output as a picture

Screenshot from 2024-11-19 10-25-02

@bytexenon
Copy link
Owner

Hello,
Thanks for opening this issue, can you please run the command realpath $(firefox) (or ls -g $(firefox)) and tell me what it shows to you? Also, can you tell me what Linux distribution you're using?

@Deslo123
Copy link
Author

thanks for quick reply when i run realpath $(firefox) command it just open firefox browser
when i run ls -g $(firefox) it just enter cmdsubst> which i dont even know what it is
Screenshot from 2024-11-20 02-16-37

@bytexenon
Copy link
Owner

bytexenon commented Nov 19, 2024

when i run realpath $(firefox) command it just open firefox browser

Oops, my bad! I meant to say realpath $(which firefox) and ls -g $(which firefox) (with which). Sorry about that.

Here's what those commands show for me:
image
image

What do you see when you run them? Also, which Linux distro are you using? Is it Ubuntu, Debian, Arch, Kali, Fedora, or maybe something else?

@Deslo123
Copy link
Author

Deslo123 commented Nov 20, 2024

this is my output and i am using manjaro linux which is arch based distro
Screenshot from 2024-11-20 02-59-23

@bytexenon
Copy link
Owner

this is my output and i am using manjaro linux which is arch based distro

Got it, thanks for the info! I'll aim to release a fix in the next few hours

@bytexenon bytexenon self-assigned this Nov 20, 2024
@Deslo123
Copy link
Author

thank you

@Deslo123
Copy link
Author

hey i saw the update and tried again to run the code but i still get the same error and i checked if i really update the package
Screenshot from 2024-11-21 04-42-27

@bytexenon
Copy link
Owner

bytexenon commented Nov 21, 2024

@Deslo123 That's super weird. It seems like undetected_geckodriver isn't just missing /usr/lib/firefox, but it can't find the Firefox binary at all. Could it be that you're running the script in some isolated setup that's preventing Python from accessing /usr/bin/ and /usr/lib/? I saw you're using a Python virtual environment, but those usually don't block access like that, so it might be something else.

Let's check a few things. Do you have the /usr/lib/firefox folder on your system? If not, can you see if /usr/bin/firefox is a shell script? Typically, this script runs the Firefox binary found in /usr/lib/firefox, which you can see in my screenshot:

image

Can you tell me what's inside that file on your setup?


Also, sometimes it might point to another binary in /usr/bin, like on one of my other systems:

image

If yours looks like this second example, use ls -g on the binary it leads to (mine's firefox-esr, but it could be firefox-developer-edition, firefox-nightly, etc.). For example, the command would look like ls -g $(which firefox-esr) for me, make sure to replace firefox-esr with the binary it points to on your system, after you run this command let me know what it outputs. In my case, it shows lrwxrwxrwx 1 root 30 Oct 9 19:17 /usr/bin/firefox-esr -> ../lib/firefox-esr/firefox-esr.

@Deslo123
Copy link
Author

i really dont think there is anything preventing me accesing firefox beacuse i can run the belllow just fine
Screenshot from 2024-11-21 13-12-45

output of cat /usr/bin/firefox:

Screenshot from 2024-11-21 13-13-05

and content of usr/lib/firefox :

Screenshot from 2024-11-21 13-19-02

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

No branches or pull requests

2 participants