FedML icon indicating copy to clipboard operation
FedML copied to clipboard

[MLOps] [cli] windows compatibility issue when "fedml login"

Open chaoyanghe opened this issue 3 years ago • 3 comments

PS C:\Users\chaoy\sourcecode\FedML\python> fedml login 201 -v local
login...True, None
c:\users\chaoy\sourcecode\fedml\python\fedml\cli\edge_deployment\client_login.py
PS C:\Users\chaoy\sourcecode\FedML\python>
PS C:\Users\chaoy\sourcecode\FedML\python> Namespace(type='login', user='201', version='local')
Traceback (most recent call last):
  File "c:\users\chaoy\sourcecode\fedml\python\fedml\cli\edge_deployment\client_login.py", line 673, in <module>
    login(args)
  File "c:\users\chaoy\sourcecode\fedml\python\fedml\cli\edge_deployment\client_login.py", line 656, in login
    __login(args, args.user, args.version)
  File "c:\users\chaoy\sourcecode\fedml\python\fedml\cli\edge_deployment\client_login.py", line 587, in __login
    setattr(args, "device_id", FedMLClientRunner.get_device_id())
  File "c:\users\chaoy\sourcecode\fedml\python\fedml\cli\edge_deployment\client_login.py", line 478, in get_device_id
    device_id = subprocess.Popen("dmidecode.exe -s system-uuid".split())
  File "C:\Users\chaoy\AppData\Local\Programs\Python\Python310\lib\subprocess.py", line 966, in __init__
    self._execute_child(args, executable, preexec_fn, close_fds,
  File "C:\Users\chaoy\AppData\Local\Programs\Python\Python310\lib\subprocess.py", line 1435, in _execute_child
    hp, ht, pid, tid = _winapi.CreateProcess(executable, args,
FileNotFoundError: [WinError 2] The system cannot find the file specified

chaoyanghe avatar Jun 05 '22 07:06 chaoyanghe

https://github.com/FedML-AI/FedML/commit/16c78406ced7b9a17b348d709852b6107733ba44

    if "nt" in os.name:
        def GetUUID():
            cmd = 'wmic csproduct get uuid'
            uuid = str(subprocess.check_output(cmd))
            pos1 = uuid.find("\\n") + 2
            uuid = uuid[pos1:-15]
            return str(uuid)
        device_id = GetUUID()
        click.echo(device_id)

chaoyanghe avatar Jun 05 '22 08:06 chaoyanghe

先出现error,然后又成功了

Image

Yvonne-fedml avatar Sep 17 '22 00:09 Yvonne-fedml

@chaoyanghe @Yvonne-fedml @fedml-alex is this resolved?

fedml-dimitris avatar Oct 25 '23 01:10 fedml-dimitris