Gio: Operation not supported

When running hello world app locally, I get following error on Python/3.11.4

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

Tried installing xdg-utils but still the app does not launch n browser automatically.
What am I missing

Please can you give your system details? What device and OS are you using? Can you confirm the code you passed to streamlit run? Also, can you confirm if the happens in a clean Python environment with only Streamlit (and its dependencies) installed?

OS: Ubuntu on WSL
Python: 3.11.10
Streamlit: 1.39.0

NOTE: Its working fine on Python Version 3.10, issue is with 3.11 and 3.12

lsb_release -a

No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu 22.04.5 LTS
Release: 22.04
Codename: jammy

$ streamlit --version
Streamlit, version 1.39.0
$ python3 --version
Python 3.11.10
$ streamlit run tmp.py

You can now view your Streamlit app in your browser.
Local URL: http://localhost:8502
Network URL: http://172.22.49.192:8502

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

I found another post about the same issue, but without a clear resolution (other than maybe rolling back to Python 3.10). I’ve put out a question internally.

1 Like

I got a reply from one of our engineers:

I have found this GitHub thread in a different repository mentioning Streamlit with a potential solution: For what is GIO used? · Issue #7 · vndee/local-assistant-examples · GitHub
According to it, it sounds like an issue with WSL itself and the fact that Streamlit tries to automatically open the browser. The comment offers a potential alternative installing xdg-utils in order to leverage xdg-open instead of gio open. Other than that it sounds you can ignore the issue and just open the app manually in the browser.

I have already tried that, and you can see my reply there For what is GIO used? · Issue #7 · vndee/local-assistant-examples · GitHub
It is not a solution.

I am opening the browser manually for now.

Installing wslu on WSL solved the issue.

Ref: AWS CLI fail to open links - e.g. the IAM Identity Center - "Operation not supported" · Issue #7892 · aws/aws-cli · GitHub

simply

sudo apt-get install wslu

or below if above does not work

sudo add-apt-repository ppa:wslutilities/wslu
sudo apt update
sudo apt install wslu

The issue apparently is WSL trying to open WSL browser instead of Windows Browser.

This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.