Skip to main content
Question

Unable to deploy streamlit app using CDF Toolkit (alpha version)

  • January 13, 2025
  • 5 replies
  • 46 views

Hi Team,

We are attempting to deploy a Streamlit app using the CDF Toolkit (alpha version), but we've encountered the following error during the process. Could you please assist us in resolving this issue so that we can effectively use the toolkit for deploying the app?

Below are some additional details for your reference:

CDF Toolkit Version: 0.3.0a7
Target CDF Project: slb-pdf
I've also attached the cdf.tmol file for your review.

 

Error Snippet:

 

from ._auth_app import AuthApp

File "/opt/hostedtoolcache/Python/3.10.16/x64/lib/python3.10/site-packages/cognite_toolkit/_cdf_tk/apps/_auth_app.py", line 6, in <module>

from cognite_toolkit._cdf_tk.commands import AuthCommand

File "/opt/hostedtoolcache/Python/3.10.16/x64/lib/python3.10/site-packages/cognite_toolkit/_cdf_tk/commands/__init__.py", line 1, in <module>

from .auth import AuthCommand

File "/opt/hostedtoolcache/Python/3.10.16/x64/lib/python3.10/site-packages/cognite_toolkit/_cdf_tk/commands/auth.py", line 34, in <module>

from cognite_toolkit._cdf_tk import loaders

File "/opt/hostedtoolcache/Python/3.10.16/x64/lib/python3.10/site-packages/cognite_toolkit/_cdf_tk/loaders/__init__.py", line 21, in <module>

from ._data_loaders import DatapointsLoader, FileLoader, RawFileLoader

File "/opt/hostedtoolcache/Python/3.10.16/x64/lib/python3.10/site-packages/cognite_toolkit/_cdf_tk/loaders/_data_loaders.py", line 18, in <module>

from ._resource_loaders import FileMetadataLoader, RawDatabaseLoader, RawTableLoader, TimeSeriesLoader

File "/opt/hostedtoolcache/Python/3.10.16/x64/lib/python3.10/site-packages/cognite_toolkit/_cdf_tk/loaders/_resource_loaders/__init__.py", line 22, in <module>

from .workflow_loaders import WorkflowLoader, WorkflowVersionLoader

File "/opt/hostedtoolcache/Python/3.10.16/x64/lib/python3.10/site-packages/cognite_toolkit/_cdf_tk/loaders/_resource_loaders/workflow_loaders.py", line 22, in <module>

from cognite.client.data_classes import (

ImportError: cannot import name 'WorkflowTriggerCreateList' from 'cognite.client.data_classes' (/opt/hostedtoolcache/Python/3.10.16/x64/lib/python3.10/site-packages/cognite/client/data_classes/__init__.py)

 

 

Thank you for your support!

Best regards,
Basudeba Mandal

5 replies

Mithila Jayalath
Seasoned Practitioner
Forum|alt.badge.img

@Basudeba Mandal can you please upgrade the toolkit to the latest version(0.3.25) and check whether you are still observing this issue?

You can use the following command to upgrade the toolkit version.

pip install --upgrade cognite-toolkit

 


Anders  Albert
Seasoned Practitioner
Forum|alt.badge.img
  • Seasoned Practitioner
  • 96 replies
  • January 20, 2025

@Basudeba Mandal 
The issue seems to be that there is a bug in the underlying `cognite-sdk` which the Toolkit is using. This was fixed a while back. Can you also upgrade that to the latest? The most recent version as of my writing is `7.72.1`.Note you can always check pypi for the latest.

 

I have checked your cdf.toml file, and it is correct. However, as ​@Mithila Jayalath is saying you need to upgrade the Toolkit to the latest version, as your version of Toolkit does not have the streamlit alpha feature available.


Hi ​@Anders Albert  ​@Mithila Jayalath  Thanks for responding to this thread.

 

I have tried using latest version of cognite toolkit and cognite sdk, however It could not deploy the streamlit app. Following scenarios are tried. Could you please look into it and help us deploy the streamlit app using toolkit ?

If required, We can look into it together over a call. Kindly let me know.

 

Scenario 1 :: 

I have used stable version of toolkit and tried to deploy streamlit app. (Toolkit Version:  0.3.27  and Cognite SDK version:  7.72.2 ), following error is observed. Attached screenshot as well.

 

ERROR (ToolkitMissingModuleError): The following selected modules are missing,

please check path: {PosixPath('modules/streamlit')}.

HINT A module is a directory with one or more resource directories in it.

Available resource directories are ['3dmodels', 'auth', 'classic',

'data_models', 'data_sets', 'extraction_pipelines', 'files', 'functions',

'hosted_extractors', 'locations', 'raw', 'robotics', 'timeseries',

'transformations', 'workflows']

 

 

Scenario 2 :: 

I have used alpha version of toolkit and tried to deploy streamlit app. (Toolkit Version:  0.3.0a7  and Cognite SDK version:  7.72.2 ), following error is observed. Attached screenshot as well.

 

Traceback (most recent call last):

File "/opt/hostedtoolcache/Python/3.10.16/x64/bin/cdf", line 5, in <module>

from cognite_toolkit._cdf import app

File "/opt/hostedtoolcache/Python/3.10.16/x64/lib/python3.10/site-packages/cognite_toolkit/_cdf.py", line 21, in <module>

from cognite_toolkit._cdf_tk.apps import AuthApp, CoreApp, LandingApp, ModulesApp, RepoApp, RunApp

File "/opt/hostedtoolcache/Python/3.10.16/x64/lib/python3.10/site-packages/cognite_toolkit/_cdf_tk/apps/__init__.py", line 1, in <module>

from ._auth_app import AuthApp

File "/opt/hostedtoolcache/Python/3.10.16/x64/lib/python3.10/site-packages/cognite_toolkit/_cdf_tk/apps/_auth_app.py", line 6, in <module>

from cognite_toolkit._cdf_tk.commands import AuthCommand

File "/opt/hostedtoolcache/Python/3.10.16/x64/lib/python3.10/site-packages/cognite_toolkit/_cdf_tk/commands/__init__.py", line 1, in <module>

from .auth import AuthCommand

File "/opt/hostedtoolcache/Python/3.10.16/x64/lib/python3.10/site-packages/cognite_toolkit/_cdf_tk/commands/auth.py", line 34, in <module>

from cognite_toolkit._cdf_tk import loaders

File "/opt/hostedtoolcache/Python/3.10.16/x64/lib/python3.10/site-packages/cognite_toolkit/_cdf_tk/loaders/__init__.py", line 21, in <module>

from ._data_loaders import DatapointsLoader, FileLoader, RawFileLoader

File "/opt/hostedtoolcache/Python/3.10.16/x64/lib/python3.10/site-packages/cognite_toolkit/_cdf_tk/loaders/_data_loaders.py", line 18, in <module>

from ._resource_loaders import FileMetadataLoader, RawDatabaseLoader, RawTableLoader, TimeSeriesLoader

File "/opt/hostedtoolcache/Python/3.10.16/x64/lib/python3.10/site-packages/cognite_toolkit/_cdf_tk/loaders/_resource_loaders/__init__.py", line 22, in <module>

from .workflow_loaders import WorkflowLoader, WorkflowVersionLoader

File "/opt/hostedtoolcache/Python/3.10.16/x64/lib/python3.10/site-packages/cognite_toolkit/_cdf_tk/loaders/_resource_loaders/workflow_loaders.py", line 22, in <module>

from cognite.client.data_classes import (

ImportError: cannot import name 'WorkflowTriggerCreateList' from 'cognite.client.data_classes' (/opt/hostedtoolcache/Python/3.10.16/x64/lib/python3.10/site-packages/cognite/client/data_classes/__init__.py)


  • Architect
  • 14 replies
  • January 22, 2025

Hi ​@Basudeba Mandal , I wonder if the file structure is correct? 

It should be something like 

modules/<module name>/streamlit/<my_streamlit_app>
modules/<module name>/streamlit/my.streamlit.yaml 

An example here: 



 


Thank you ​@palronning . Its working now.


Reply


Cookie Policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie Settings