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

Win11 Livekit Server - ImportError: cannot import name 'api' from 'livekit' (unknown location) #302

Open
macazaga opened this issue Sep 7, 2024 · 2 comments

Comments

@macazaga
Copy link

macazaga commented Sep 7, 2024

Describe the bug
After following the guide for 01 in Windows I runned the command:
poetry run 01 --server livekit --qr --expose

And powershell / cmd shows the following:
Using python3.11 (3.11.9)
⠴ Traceback (most recent call last):
File "", line 1, in
File "C:\Users\maca1\Miniconda3\Lib\importlib_init_.py", line 90, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "", line 1387, in _gcd_import
File "", line 1360, in _find_and_load
File "", line 1331, in _find_and_load_unlocked
File "", line 935, in _load_unlocked
File "", line 995, in exec_module
File "", line 488, in _call_with_frames_removed
File "M:\oi\01\software\main.py", line 17, in
from livekit import api
ImportError: cannot import name 'api' from 'livekit' (unknown location)

Screenshots
image

Desktop:

  • OS: Windows 11
  • Python Version: 3.11.9

Additional context
I also tried running the light server:
poetry run 01 --server light

And returns the same error.

@KillianLucas
Copy link
Collaborator

Hey @macazaga! We're working on better Windows docs, let me know if this is helpful: https://01.openinterpreter.com/software/server/windows-livekit

You might want to try poetry env remove 3.11 then run poetry install again — that has fixed this specific error for me before.

@macazaga
Copy link
Author

Hi @KillianLucas , thank you for your response! I honestly felt like I got a message from a celebrity. Congrats on this incredible project!

I followed the steps you shared and now I've a different error.
The ngrok agent is visible in the dashboard:

image

but this happens when I run the command line:
poetry run 01 --server livekit --qr --expose

Starting light server (required for livekit server) on localhost, on the port before --server-port (port 10100), unless the AN_OPEN_PORT env var is set.
The livekit server will be started on port 10101.
Starting server...
The filename, directory name, or volume label syntax is incorrect.
Exception in thread Thread-3 (run_command):
Traceback (most recent call last):
File "C:\Users\maca1.pyenv\pyenv-win\versions\3.11.9\Lib\threading.py", line 1045, in _bootstrap_inner
self.run()
File "C:\Users\maca1.pyenv\pyenv-win\versions\3.11.9\Lib\threading.py", line 982, in run
self._target(*self._args, **self._kwargs)
File "M:\01\software\main.py", line 153, in run_command
subprocess.run(command, shell=True, check=True)
File "C:\Users\maca1.pyenv\pyenv-win\versions\3.11.9\Lib\subprocess.py", line 571, in run
raise CalledProcessError(retcode, process.args,
subprocess.CalledProcessError: Command 'M:\software\livekit-server --dev --bind "localhost" --port 10101' returned non-zero exit status 1.
Livekit server will run at: https://1884-2600-1700-15b-2800-8c4e-e245-fc1a-927d.ngrok-free.app
Server will run at http://localhost:10100
INFO: Started server process [38020]
INFO: Waiting for application startup.
INFO: Application startup complete.
INFO: Uvicorn running on http://localhost:10100 (Press CTRL+C to quit)
error connecting to upstream error=No connection could be made because the target machine actively refused it. (os error 10061)
error connecting to upstream error=No connection could be made because the target machine actively refused it. (os error 10061)
error connecting to upstream error=No connection could be made because the target machine actively refused it. (os error 10061)
error connecting to upstream error=No connection could be made because the target machine actively refused it. (os error 10061)
error connecting to upstream error=No connection could be made because the target machine actively refused it. (os error 10061)
error connecting to upstream error=No connection could be made because the target machine actively refused it. (os error 10061)
error connecting to upstream error=No connection could be made because the target machine actively refused it. (os error 10061)
error connecting to upstream error=No connection could be made because the target machine actively refused it. (os error 10061)
error connecting to upstream error=No connection could be made because the target machine actively refused it. (os error 10061)
error connecting to upstream error=No connection could be made because the target machine actively refused it. (os error 10061)
╭───────────────────────────────────────── Traceback (most recent call last) ──────────────────────────────────────────╮
│ M:\01\software\main.py:232 in run │
│ │
│ 229 │ │ │ │ pass │
│ 230 │ │ │ time.sleep(1) │
│ 231 │ │ else: │
│ ❱ 232 │ │ │ raise Exception(f"Server at {url} failed to respond after 10 attempts") │
│ 233 │ │ │
│ 234 │ │ ### DISPLAY QR CODE │
│ 235 │ │ if qr: │
│ │
│ ╭─────────────────────────────────────────── locals ───────────────────────────────────────────╮ │
│ │ attempt = 9 │ │
│ │ client = None │ │
│ │ command = 'M:\x01\software\livekit-server --dev --bind "localhost" --port 10101' │ │
│ │ debug = False │ │
│ │ domain = None │ │
│ │ expose = True │ │
│ │ light_server_host = 'localhost' │ │
│ │ light_server_port = 10100 │ │
│ │ listener = <builtins.Listener object at 0x0000026C55759E70> │ │
│ │ livekit_thread = <Thread(Thread-3 (run_command), stopped 38412)> │ │
│ │ local_livekit_url = 'ws://localhost:10101' │ │
│ │ profile = 'M:\01\software\source\server\profiles\default.py' │ │
│ │ profiles = False │ │
│ │ profiles_dir = 'M:\01\software\source\server\profiles' │ │
│ │ qr = True │ │
│ │ response = <Response [503]> │ │
│ │ run_command = <function run..run_command at 0x0000026C4CDED080> │ │
│ │ server = 'livekit' │ │
│ │ server_host = 'localhost' │ │
│ │ server_port = 10101 │ │
│ │ server_thread = <Thread(Thread-2 (start_server), started 21240)> │ │
│ │ server_url = 'localhost:10101' │ │
│ │ signal_handler = <function run..signal_handler at 0x0000026C5574B060> │ │
│ │ status = 'Not OK' │ │
│ │ threads = [ │ │
│ │ │ <Thread(Thread-2 (start_server), started 21240)>, │ │
│ │ │ <Thread(Thread-3 (run_command), stopped 38412)> │ │
│ │ ] │ │
│ │ url = 'https://1884-2600-1700-15b-2800-8c4e-e245-fc1a-927d.ngrok-free.app' │ │
│ │ voice = False │ │
│ ╰──────────────────────────────────────────────────────────────────────────────────────────────╯ │
╰──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯
Exception: Server at https://1884-2600-1700-15b-2800-8c4e-e245-fc1a-927d.ngrok-free.app failed to respond after 10
attempts

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