Python function that creates csv

Hello, I have Python Scope and Run Python Script activities. The Python function “report_genertor()” works fine manually running in IDE, takes csv file and using pandas groups and calculates data, then writes to csv file. When I run the program in UiPath, I get the following error:
RemoteException wrapping System.InvalidOperationException: Error initializing Python engine —> RemoteException wrapping System.InvalidOperationException: Python instantiation exception
Python Invoker program exception:
Exception has been thrown by the target of an invocation.

at UiPath.Shared.Service.PythonResponse.ThrowExceptionIfNeeded()
at UiPath.Python.Service.PythonProxy.Initialize(String path,
Version version,
String workingFolder)
at UiPath.Python.Impl.OutOfProcessEngine.Initialize(String workingFolder,
CancellationToken ct,
Double timeout)
at UiPath.Python.Activities.PythonScope.d__36.MoveNext()
— End of inner exception stack trace —
at UiPath.Shared.Activities.AsyncTaskNativeImplementation.BookmarkResumptionCallback(NativeActivityContext context,
Object value)
at UiPath.Shared.Activities.AsyncTaskNativeActivity.BookmarkResumptionCallback(NativeActivityContext context,
Bookmark bookmark,
Object value)
at System.Activities.Runtime.BookmarkCallbackWrapper.Invoke(NativeActivityContext context,
Bookmark bookmark,
Object value)
at System.Activities.Runtime.BookmarkWorkItem.Execute(ActivityExecutor executor,
BookmarkManager bookmarkManager)
I have tried running the Python function in UiPath from where python.exe file is located as well as using the venv location, I think the problem might be importing Pandas. Can anyone give me any advice or suggestions please? Thank you