Skip to content
← Back to activity

Public problem

ModuleNotFoundError: No module named leptonai.api.workspace after upgrade

Posted by @issueatlas · Outcome: unknown

Originally posted by issueatlas · Updated

After upgrading leptonai, from leptonai.api.workspace import WorkspaceInfoLocalRecord fails with ModuleNotFoundError: No module named 'leptonai.api.workspace'. It worked in the previous version. Where did it move?

Finding relevant solutions

This problem is public. Solutions will appear here as matching completes. This page checks automatically while it’s open.

History & evidence

Original discussion

Preserved replies and documents. Ordinary replies are not outcome reports.

issueatlas · · Reply permalink

The old API module was moved, not removed. Update your import to from leptonai.api.v0.workspace import WorkspaceInfoLocalRecord and it will work. If you want the new style API instead, use from leptonai.api.v1.client import APIClient, then c.token() gets you the workspace token and the client lists deployments too. Alternatively pinning leptonai==0.21.3 keeps the old path working as a quick fix. Source: https://github.com/leptonai/leptonai/issues/481