livekit / livekit-server-sdk-python

LiveKit Server SDK for Python
Apache License 2.0
26 stars 7 forks source link

Cannot import when installed via poetry #7

Closed v3ss0n closed 1 year ago

v3ss0n commented 1 year ago

After adding in poetry , i got error at runtime that livekit module not found.

v3ss0n commented 1 year ago

sprintlog-backend-sprintlog-1 | File "/workspace/app/src/app/init.py", line 5, in sprintlog-backend-sprintlog-1 | from app import asgi, cli, domain, lib, utils sprintlog-backend-sprintlog-1 | File "/workspace/app/src/app/cli.py", line 13, in sprintlog-backend-sprintlog-1 | from app.domain.accounts.schemas import UserCreate, UserUpdate sprintlog-backend-sprintlog-1 | File "/workspace/app/src/app/domain/init.py", line 18, in sprintlog-backend-sprintlog-1 | from . import accounts, analytics, backlogs, openapi, plugins, projects, room, security, system, teams, urls sprintlog-backend-sprintlog-1 | File "/workspace/app/src/app/domain/room/init.py", line 1, in sprintlog-backend-sprintlog-1 | from . import controller sprintlog-backend-sprintlog-1 | File "/workspace/app/src/app/domain/room/controller.py", line 4, in sprintlog-backend-sprintlog-1 | from livekit import RoomServiceClient,VideoGrant,AccessToken sprintlog-backend-sprintlog-1 | ModuleNotFoundError: No module named 'livekit' sprintlog-backend-sprintlog-1 exited with code 0

v3ss0n commented 1 year ago

it imports fine in python shell

AlexJMohr commented 1 year ago

Not able to reproduce this. Here are my steps:

$ poetry init
$ poetry add livekit-server-sdk-python
$ poetry install
# test.py
from livekit import RoomServiceClient,VideoGrant,AccessToken
$ poetry run python test.py

Are you sure you are running your program in the virtual environment from poetry? i.e. with poetry run or poetry shell

AlexJMohr commented 1 year ago

Closing for now