Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

July 7 - July 17 | Round 2 of the Power BI Dataviz World Championships. Don't miss your chance! Learn more

Reply
userpowerbiii12
Frequent Visitor

Module Not Found Error: No module named 'pycaret.nlp'

I'm trying to use the LDA topic modeling algorithm inside Power BI.

 

My python environement has the version Python 3.8.17

I'm trying to run a Python script inside Power BI

 

from pycaret.nlp import *
dataset = get_topics(dataset, text='cons', model='lda', num_topics=6,learning_decay=0.7)

This error I get: 

 
 

userpowerbiii12_3-1689598298198.png

I'm using currently Pycaret version 3.0.4. I tried to downgrade the version of Pycaret to 2.3.10 but other packages will be affected and somehow it starts to generate version confusion for me.

 

DataSource.Error: ADO.NET: Python script error.
<pi>KeyError: 'layout'

During handling of the above exception, another exception occurred:

NotImplementedError: Cannot 
</pi>
Details:
    DataSourceKind=Python
    DataSourcePath=Python
    Message=Python script error.
<pi>KeyError: 'layout'

During handling of the above exception, another exception occurred:

NotImplementedError: Cannot 
</pi>
    ErrorCode=-2147467259
    ExceptionType=Microsoft.PowerBI.Scripting.Python.Exceptions.PythonScriptRuntimeException
 

Note that I followed this article (which is 2 years old) that explains the steps on how to apply this on Power BI.

How can I resolve my issue?

 

 

 

 

0 REPLIES 0

Helpful resources

Announcements
FabCon and SQLCon Barcelona 2026

FabCon & SQLCon – Barcelona 2026

Join us in Barcelona for FabCon and SQLCon, the Fabric, Power BI, SQL, and AI community event. Save €200 with code FABCMTY200.

60 days of Data Days Carousel

Data Days 2026

Join Data Days 2026: 60 days of free live/on-demand sessions, challenges, study groups, and certification opportunities.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.