0

while coding a Python-based AI when we are to access the internet through it. The Default web browser opens is Internet Explorer. How to get chrome as default?

3
  • It would help if you provided at least a sample of the code used for opening the browser. Commented Aug 31, 2021 at 7:20
  • I think changing your default browser on your OS should fix this. If you're using anaconda/jupyter, use this. Commented Aug 31, 2021 at 7:41
  • Please provide enough code so others can better understand or reproduce the problem. Commented Sep 2, 2021 at 17:22

1 Answer 1

1

I don't know the specifics of how your AI framework opens a browser nor the operating system you are using. I am using windows 10 and have installed Chrome in the default location.

Changing your default browser using the operating system, may work:

  • Open Default apps
  • Under Web browser, select the browser currently listed, and then select Google Chrome

Or you can use this method - it works even if chrome isn't your default browser:

import webbrowser url = 'https://www.python.org' path = 'C:/Program Files/Google/Chrome/Application/chrome.exe' webbrowser.register('mybrowser', None, webbrowser.BackgroundBrowser(path)) webbrowser.get('mybrowser').open(url) 

You can fetch the location of the chrome executable from the registry with the key:

HKML\SOFTWARE\Microsoft\Windows\CurrentVersion\App Paths\chrome.exe 

Or find it using the shell command:

dir /s /b \chrome.exe 

See also:
How to change the default browser used by jupyter in windows
How to change the default browser used by jupyter in Linux
Change your default browser in Windows 10

Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.