joshrobbins just spent the last few hours doing the same (switching to nltk).
Been in a nightmare where on-premise (personal) gateway wont import nltk (or anything else I'm pip install(ing).
Any thougths there?
When I pip install it goes to a path "C:\Users\User\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0\LocalCache\local-packages\Python310\site-packages"
I see the installed modules, but power bi refresh gives:
Data source error: {"error":{"code":"DM_GWPipeline_Gateway_MashupDataAccessError","pbi.error":{"code":"DM_GWPipeline_Gateway_MashupDataAccessError","parameters":{},"details":[{"code":"DM_ErrorDetailNameCode_UnderlyingErrorCode","detail":{"type":1,"value":"-2147467259"}},{"code":"DM_ErrorDetailNameCode_UnderlyingErrorMessage","detail":{"type":1,"value":"ADO.NET: Python script error.\r\nModuleNotFoundError: No module named 'nltk'\r\n</pi>"}},{"code":"DM_ErrorDetailNameCode_UnderlyingHResult","detail":{"type":1,"value":"-2147467259"}},{"code":"Microsoft.Data.Mashup.ValueError.DataSourceKind","detail":{"type":1,"value":"Python"}},{"code":"Microsoft.Data.Mashup.ValueError.DataSourcePath","detail":{"type":1,"value":"Python"}},{"code":"Microsoft.Data.Mashup.ValueError.ErrorCode","detail":{"type":1,"value":"-2147467259"}},{"code":"Microsoft.Data.Mashup.ValueError.ExceptionType","detail":{"type":1,"value":"Microsoft.PowerBI.Scripting.Python.Exceptions.PythonScriptRuntimeException"}},{"code":"Microsoft.Data.Mashup.ValueError.Message","detail":{"type":1,"value":"Python script error.\r\n<pi>ModuleNotFoundError: No module named 'nltk'\r\n</pi>"}},{"code":"Microsoft.Data.Mashup.ValueError.Reason","detail":{"type":1,"value":"DataSource.Error"}}],"exceptionCulprit":1}}} Table: Table.
Cluster URI: WABI-US-CENTRAL-A-PRIMARY-redirect.analysis.windows.net
Activity ID: 79255ad2-8909-4e87-b41d-8eebdd946da3
Request ID: 06d21e6a-2f22-f74f-146a-eddc6976aa71
Time: 2024-07-17 21:57:38Z
if I run python from command prompt on the personal gateway machine, I can import and run nltk just fine.
python scripting on gateway works if I dont use any extra modules.