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

[bug] "firefox" browser was not found. #477

Closed
mrthevinh opened this issue Feb 2, 2021 · 11 comments
Closed

[bug] "firefox" browser was not found. #477

mrthevinh opened this issue Feb 2, 2021 · 11 comments
Labels

Comments

@mrthevinh
Copy link

mrthevinh commented Feb 2, 2021

playwright playwright==1.8.0a1
playwright install
Run my script with firefox erro.. webkit and chrome still work

"firefox" browser was not found.
Please complete Playwright installation via running

    "python -m playwright install"
@pavelfeldman
Copy link
Member

That's unusual, we have bots testing it. Could you share more on your OS and Python version? I assume first line of your bug should have been

pip install playwright==1.8.0a1

@mrthevinh
Copy link
Author

My OS is window 10 python 3.9. I try it on python 3.7 and 3.8 too but firefox still dont work!

    browser = browser_type.launch()
  File "C:\Users\The Vinh\AppData\Local\Programs\Python\Python39\lib\site-packages\playwright\sync_api.py", line 6974, in launch
    self._sync(
  File "C:\Users\The Vinh\AppData\Local\Programs\Python\Python39\lib\site-packages\playwright\_sync_base.py", line 97, in _sync
    return future.result()
  File "C:\Users\The Vinh\AppData\Local\Programs\Python\Python39\lib\site-packages\playwright\_browser_type.py", line 77, in launch
    raise not_installed_error(f'"{self.name}" browser was not found.')
Exception: 

Could you tell me how to debug it to get more report

@mxschmitt
Copy link
Member

mxschmitt commented Feb 4, 2021

Could you try to add a print(e) of the original exception in C:\Users\The Vinh\AppData\Local\Programs\Python\Python39\lib\site-packages\playwright\_browser_type.py line 75 and provide us the output of that?
That should give us more information.

@mrthevinh
Copy link
Author

mrthevinh commented Feb 6, 2021

@mxschmitt thank your reply..
My code:

from playwright.sync_api import sync_playwright
with sync_playwright() as p:
    for browser_type in [p.firefox]:
        browser = browser_type.launch()
        page = browser.newPage()
        page.goto('http://whatsmyuseragent.org/')
        page.screenshot(path=f'example-{browser_type.name}.png')
        browser.close()

My error log show when I add print(e):

ERROR: The process "39608" not found.
Traceback (most recent call last):
  File "C:\Users\The Vinh\AppData\Local\Programs\Python\Python39\lib\site-packages\playwright\_impl\_browser_type.py", line 70, in launch
    return from_channel(await self._channel.send("launch", params))
  File "C:\Users\The Vinh\AppData\Local\Programs\Python\Python39\lib\site-packages\playwright\_impl\_connection.py", line 36, in send
    return await self.inner_send(method, params, False)
  File "C:\Users\The Vinh\AppData\Local\Programs\Python\Python39\lib\site-packages\playwright\_impl\_connection.py", line 47, in inner_send
    result = await callback.future
playwright._impl._api_types.Error: Protocol error (Browser.enable): Browser closed.
==================== Browser output: ====================
<launching> C:\Users\The Vinh\AppData\Local\ms-playwright\firefox-1225\firefox\firefox.exe -no-remote -headless -profile C:\Users\THEVIN~1\AppData\Local\Temp\playwright_firefoxdev_profile-qVvGyZ -juggler-pipe -silent
<launched> pid=39608
[err] *** You are running in headless mode.
[out] 
[out] Juggler listening to the pipe
[out] console.warn: SearchSettings: "get: No settings file exists, new profile?" (new Error("", "(unknown module)"))
[err] JavaScript error: resource://gre/modules/XULStore.jsm, line 66: Error: Can't find profile directory.
[err] 
[err] ###!!! [Child][MessageChannel] Error: (msgtype=0x3A0147,name=PContent::Msg_AsyncMessage) Channel closing: too late to send/recv, messages will be lost
[err] 
[err] JavaScript error: resource://activity-stream/lib/ASRouterNewTabHook.jsm, line 61: TypeError: this._router is null
[out] console.error: Region.jsm: "Error fetching region" (new TypeError("NetworkError when attempting to fetch resource.", "chrome://juggler/content/NetworkObserver.js", 421))
[out] console.error: Region.jsm: "Failed to fetch region" (new Error("NO_RESULT", "resource://gre/modules/Region.jsm", 422))
[err] 
[err] ###!!! [Child][RunMessage] Error: Channel closing: too late to send/recv, messages will be lost
[err] 
=========================== logs ===========================
<launching> C:\Users\The Vinh\AppData\Local\ms-playwright\firefox-1225\firefox\firefox.exe -no-remote -headless -profile C:\Users\THEVIN~1\AppData\Local\Temp\playwright_firefoxdev_profile-qVvGyZ -juggler-pipe -silent
<launched> pid=39608
[err] *** You are running in headless mode.
[out] 
[out] Juggler listening to the pipe
[out] console.warn: SearchSettings: "get: No settings file exists, new profile?" (new Error("", "(unknown module)"))
[err] JavaScript error: resource://gre/modules/XULStore.jsm, line 66: Error: Can't find profile directory.
[err] 
[err] ###!!! [Child][MessageChannel] Error: (msgtype=0x3A0147,name=PContent::Msg_AsyncMessage) Channel closing: too late to send/recv, messages will be lost
[err] 
[err] JavaScript error: resource://activity-stream/lib/ASRouterNewTabHook.jsm, line 61: TypeError: this._router is null
[out] console.error: Region.jsm: "Error fetching region" (new TypeError("NetworkError when attempting to fetch resource.", "chrome://juggler/content/NetworkObserver.js", 421))
[out] console.error: Region.jsm: "Failed to fetch region" (new Error("NO_RESULT", "resource://gre/modules/Region.jsm", 422))
[err] 
[err] ###!!! [Child][RunMessage] Error: Channel closing: too late to send/recv, messages will be lost
[err] 
============================================================
Note: use DEBUG=pw:api environment variable and rerun to capture Playwright logs.

During handling of the above exception, another exception occurred:

@mxschmitt
Copy link
Member

mxschmitt commented Feb 6, 2021

Thanks thats helpful!

@aslushnikov maybe Firefox is confused because there is a ~ in the user name?

And in Python should be ensured, that such errors get displayed.

@mrthevinh
Copy link
Author

Thanks @mxschmitt !
I add executable_path and firefox work great!

@astr0-g
Copy link

astr0-g commented Feb 7, 2021

Thanks @mxschmitt !
I add executable_path and firefox work great!

Hi, I had the same problem 2 days ago, happy to see your posts, after using the print(e), I have the C:\Users\ADMINI~1\AppData\ as you have above, could you help me how to add excutable_path, please?

@mrthevinh
Copy link
Author

@wg326

# copy your playwright filefox folder to C hdd
 path_ff = r'C:\firefox\firefox.exe'
 browser = browser_type.launch(executable_path=path_ff)

@astr0-g
Copy link

astr0-g commented Feb 8, 2021

@wg326

# copy your playwright filefox folder to C hdd
 path_ff = r'C:\firefox\firefox.exe'
 browser = browser_type.launch(executable_path=path_ff)

@Martyheavey
Thank you so much!

@kumaraditya303
Copy link
Contributor

Playwright has a new stable release so upgrade to it and try.

$ pip install playwright -U 

@pavelfeldman
Copy link
Member

I believe this is fixed now

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

No branches or pull requests

5 participants