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

ValueError: preexec_fn is not supported on Windows platforms #9

Open
nadendlatharak opened this issue Jan 25, 2025 · 3 comments
Open

Comments

@nadendlatharak
Copy link

Hi,

I tried running it on my windows machine and i was facing this issue. does this only work in linux ?

AttributeError: module 'os' has no attribute 'setsid'. Did you mean: 'getpid'?
(os-computer-use-py3.12) PS C:\Users\Nadendla Tharak\open-computer-use> poetry run start
Loaded as API: https://maxiw-os-atlas.hf.space ✔
Using AnthropicProvider with claude-3-5-sonnet-20241022
Using AnthropicProvider with claude-3-5-sonnet-20241022
Starting the display server...
(The display client will start in five seconds.)
Stopping the display client...
Stopping the sandbox...
Saving the stream as mp4...
'ffmpeg' is not recognized as an internal or external command,
operable program or batch file.
Failed to save the stream as ./output/run_2/output.mp4.
Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "C:\Users\Nadendla Tharak\open-computer-use\main.py", line 91, in main
    loop.run_until_complete(start(user_input=args.prompt, output_dir=output_dir))
  File "C:\Users\Nadendla Tharak\AppData\Local\Programs\Python\Python312\Lib\asyncio\base_events.py", line 687, in run_until_complete
    return future.result()
           ^^^^^^^^^^^^^^^
  File "C:\Users\Nadendla Tharak\open-computer-use\main.py", line 31, in start
    await client.start_display_client(stream_url, user_input or "Sandbox", delay=5)
  File "C:\Users\Nadendla Tharak\open-computer-use\os_computer_use\streaming.py", line 32, in start_display_client
    self.process = await asyncio.create_subprocess_shell(
                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\Nadendla Tharak\AppData\Local\Programs\Python\Python312\Lib\asyncio\subprocess.py", line 211, in create_subprocess_shell
    transport, protocol = await loop.subprocess_shell(
                          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\Nadendla Tharak\AppData\Local\Programs\Python\Python312\Lib\asyncio\base_events.py", line 1711, in subprocess_shell
    transport = await self._make_subprocess_transport(
                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\Nadendla Tharak\AppData\Local\Programs\Python\Python312\Lib\asyncio\windows_events.py", line 400, in _make_subprocess_transport
    transp = _WindowsSubprocessTransport(self, protocol, args, shell,
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\Nadendla Tharak\AppData\Local\Programs\Python\Python312\Lib\asyncio\base_subprocess.py", line 36, in __init__
    self._start(args=args, shell=shell, stdin=stdin, stdout=stdout,
  File "C:\Users\Nadendla Tharak\AppData\Local\Programs\Python\Python312\Lib\asyncio\windows_events.py", line 878, in _start
    self._proc = windows_utils.Popen(
                 ^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\Nadendla Tharak\AppData\Local\Programs\Python\Python312\Lib\asyncio\windows_utils.py", line 153, in __init__
    super().__init__(args, stdin=stdin_rfd, stdout=stdout_wfd,
  File "C:\Users\Nadendla Tharak\AppData\Local\Programs\Python\Python312\Lib\subprocess.py", line 844, in __init__
    raise ValueError("preexec_fn is not supported on Windows "
ValueError: preexec_fn is not supported on Windows platforms
@jamesmurdza
Copy link
Collaborator

Hi! I haven't tested it on Windows.

The problem here is that the video streaming client uses FFmpeg. I've never done this before, but you could try this:

  1. Install Chocolatey: https://chocolatey.org/install
  2. Run choco install ffmpeg -y to install FFmpeg

@jamesmurdza
Copy link
Collaborator

Were you able to make any progress?

@nadendlatharak
Copy link
Author

Sorry i got busy in other things, i just installed it using scoop and it works.

Moreover, the preexec_fn=os.setsid, in streaming.py --> DisplayClient(Class) --> start_display_client(Fn) throws errror in windows.
i just commented it out and it works perfectly normal.

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

2 participants