UiPath Python Integration: "ImportError: No module named sqlite3" Despite Working requests Module

UiPath Python Integration: “ImportError: No module named sqlite3” Despite Working requests Module

Problem Summary

I’m encountering a sqlite3 module import error when running Python scripts through UiPath, even though other modules like requests work fine.

Environment Details

  • OS: Windows 11 (Build 10.0.26100)
  • UiPath Version: 23.10.0+Branch.master.Sha.e038c5a32a4f890ba12a3c04ac465dc8811521e0
  • Python Integration: UiPath Python Activities

Error Details

When executing a Python script in UiPath that requires sqlite3, I get the following complete error:

Source: Loading Python Script  
Message: One or more errors occurred.(加载Python脚本时出错)  
Exception Type: System.AggregateException 23.10.0+Branch.master.Sha.e038c5a32a4f890ba12a3c04ac465dc8811521e0

System.AggregateException: One or more errors occurred. (加载 Python 脚本时出错) 
---> System.InvalidOperationException: 加载 Python 脚本时出错 
---> System.InvalidOperationException: Python 实例化异常

Python Invoker program exception:
ImportError : No module named sqlite3

   at UiPath.Shared.Service.PythonResponse.ThrowExceptionIfNeeded()
   at UiPath.Python.Service.PythonProxy.LoadScript(String code)
   at UiPath.Python.Impl.OutOfProcessEngine.<>c__DisplayClass14_0.<LoadScript>b__0()
   at System.Threading.Tasks.Task`1.InnerInvoke()
   at System.Threading.Tasks.Task.<>c.<.cctor>b__272_0(Object obj)
   at System.Threading.ExecutionContext.RunFromThreadPoolDispatchLoop(Thread threadPoolThread, ExecutionContext executionContext, ContextCallback callback, Object state)
--- End of stack trace from previous location ---
   at System.Threading.ExecutionContext.RunFromThreadPoolDispatchLoop(Thread threadPoolThread, ExecutionContext executionContext, ContextCallback callback, Object state)
   at System.Threading.Tasks.Task.ExecuteWithThreadLocal(Task& currentTaskSlot, Thread threadPoolThread)
--- End of stack trace from previous location ---
   at UiPath.Python.Activities.LoadScript.ExecuteAsync(AsyncCodeActivityContext context, CancellationToken cancellationToken)
--- End of inner exception stack trace ---
   at UiPath.Python.Activities.LoadScript.ExecuteAsync(AsyncCodeActivityContext context, CancellationToken cancellationToken)
--- End of inner exception stack trace ---
   at UiPath.Shared.Activities.AsyncTaskCodeActivity.EndExecute(AsyncCodeActivityContext context, IAsyncResult result)
   at System.Activities.AsyncCodeActivity.System.Activities.IAsyncCodeActivity.FinishExecution(AsyncCodeActivityContext context, IAsyncResult result)
   at System.Activities.AsyncCodeActivity.CompleteAsyncCodeActivityData.CompleteAsyncCodeActivityWorkItem.Execute(ActivityExecutor executor, BookmarkManager bookmarkManager)
--- End of stack trace from previous location ---
   at UiPath.Executor.BaseRunner.EndExecute(IAsyncResult result)
   at UiPath.Executor.InProcessRunner.EndExecute(IAsyncResult result)
   at UiPath.Core.Activities.ExecutorInvokeActivity.EndExecute(AsyncCodeActivityContext context, IAsyncResult result)
   at System.Activities.AsyncCodeActivity.System.Activities.IAsyncCodeActivity.FinishExecution(AsyncCodeActivityContext context, IAsyncResult result)
   at System.Activities.AsyncCodeActivity.CompleteAsyncCodeActivityData.CompleteAsyncCodeActivityWorkItem.Execute(ActivityExecutor executor, BookmarkManager bookmarkManager)

What Works

  • Other Python modules like requests import and work correctly
  • The Python environment seems to be properly configured for most operations

What I’ve Tried

  • Verified that sqlite3 is typically included in Python standard library
  • Confirmed other modules work fine in the same UiPath environment

Questions

  1. Why would sqlite3 specifically be missing from UiPath’s Python environment when other modules work?
  2. How can I resolve this sqlite3 import issue in UiPath?
  3. Is this a known compatibility issue with UiPath’s Python integration?

Minimal Example

The error occurs when trying to run any Python code that imports sqlite3:

import sqlite3  # This line causes the ImportError in UiPath

While this works fine:

import requests  # This works without issues in UiPath

Outside of UiPath (in normal Anaconda Python 3.8 environment):

import sqlite3
print(sqlite3.version)  # This works perfectly fine

Any help would be greatly appreciated!

Hello @982766639!

It seems that you have trouble getting an answer to your question in the first 24 hours.
Let us give you a few hints and helpful links.

First, make sure you browsed through our Forum FAQ Beginner’s Guide. It will teach you what should be included in your topic.

You can check out some of our resources directly, see below:

  1. Always search first. It is the best way to quickly find your answer. Check out the image icon for that.
    Clicking the options button will let you set more specific topic search filters, i.e. only the ones with a solution.

  2. Topic that contains most common solutions with example project files can be found here.

  3. Read our official documentation where you can find a lot of information and instructions about each of our products:

  4. Watch the videos on our official YouTube channel for more visual tutorials.

Hopefully this will let you easily find the solution/information you need. Once you have it, we would be happy if you could share your findings here and mark it as a solution. This will help other users find it in the future.

Thank you for helping us build our UiPath Community!

Cheers from your friendly
Forum_Staff