Netflix / metaflow

:rocket: Build and manage real-life ML, AI, and data science projects with ease!

Home Page:https://metaflow.org

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Cardview on WSL error

wolvever opened this issue · comments

The demo code is copied from docs:

from metaflow import FlowSpec, step, card

class HelloFlow(FlowSpec):
    @card
    @step
    def start(self):
        print("HelloFlow is starting")
        self.next(self.hello)
    
    @step
    def hello(self):
        print("Say hi")
        self.next(self.end)
    
    @step
    def end(self):
        print("HelloFLow is ending")

if __name__ == "__main__":
    HelloFlow()

In windows WSL, run metaflow python code works, but can't start card view with
python demo.py card view start, output looks like this:

Start : ���ڳ������´����޷����д�����: ϵͳ�Ҳ���ָ�����ļ�����
����λ�� ��:1 �ַ�: 1
+ Start "file:///home/jucheng/proj/metaflow_demo/metaflow_card_cache/He ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : InvalidOperation: (:) [Start-Process]��InvalidOperationException
    + FullyQualifiedErrorId : InvalidOperationException,Microsoft.PowerShell.Commands.StartProcessCommand

which distro are you using for the WSL? I tried this with Ubuntu and out of the box it does not work, but I wasn't able to get the same error as you with the metaflow cards command.

What is happening is that under the hood metaflow is calling webbrowser.open for the html file path, and as WSL does not have a browser configured by default, this fails.

exporting a host system browser to the supported environment variable should fix the issue

export BROWSER="mnt/c/path-to-browser.exe"

an easy test for if WSL is able to launch a browser is

sensible-browser google.com

closing this for now as it shouldn't be a Metaflow specific issue. We can reopen if it turns out to be a reproducible bug with WSL and not missing configuration.