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

For what is GIO used? #7

Open
piregler opened this issue Mar 25, 2024 · 2 comments
Open

For what is GIO used? #7

piregler opened this issue Mar 25, 2024 · 2 comments

Comments

@piregler
Copy link

When running the script on WSL with Ubuntu i get the following output:

  You can now view your Streamlit app in your browser.

  Local URL: http://localhost:8501
  Network URL: http://172.21.20.151:8501

gio: http://localhost:8501: Operation not supported

For what is gio used and which operation is not supported?

@vndee
Copy link
Owner

vndee commented Sep 22, 2024

The gio command is part of the GNOME toolkit and is used to handle file and network operations. When you run the Streamlit app, it may attempt to open a browser using gio open if it's available on the system.

The error gio: Operation not supported likely occurs because WSL doesn't fully support the GNOME file system operations like opening a browser automatically through gio. This happens because gio is attempting to perform an operation that isn’t supported in the WSL environment, which lacks full desktop environment integration.

Solution:

  1. Manually open the browser:

    • Ignore the gio error and manually open the Streamlit app in your browser by navigating to the http://localhost:8501 URL.
  2. Disable automatic browser opening in Streamlit:

    • You can configure Streamlit to stop trying to open the browser automatically by modifying your config.toml file:
      ~/.streamlit/config.toml
      Add the following line to prevent the browser from auto-opening:
      [server]
      headless = true
  3. Use xdg-open instead of gio:

    • If you want the app to try opening the browser, install xdg-utils using:
      sudo apt install xdg-utils
    • xdg-open is more widely supported in WSL than gio and should open the browser automatically.

By manually opening the URL or changing the Streamlit configuration, you can avoid the gio error in WSL.

@krishvk
Copy link

krishvk commented Oct 6, 2024

The error is gone now, but the app does not open automatically after I install "xdg-utils". So basically, its same as before, I have to manually open the app by clicking the link, I just don't see an error.

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

3 participants