Closed andumorie closed 4 years ago
Seconded. I made a post at https://forum.uipath.com/t/python-source-file-cannot-be-found/105883 but was directed to post here on github:
"Load Python Script" activity has issues at runtime. The standard attribute __file__
is not being assigned.
Create Python scope. Load Python Script. script.py:
print(f"__file__ = {__file__}")
Returns:
__file__ = none
__file__ = C:\Users\username\UiPath\project_name\script.py
Last stable behavior: N/A Last stable version: 2018.4.5 Enterprise OS Version: Win10 Pro 64-Bit
Others if Relevant: (workflow, logs, .net version, service pack, etc):
Python 3.6.8 Anaconda Inc. 64-bit
This issue was fixed in package version 1.0.7053.27728 with the addition of the Working Folder property of the Python Scope activity. Setting the Working Folder property to the current directory now allows other local Python files/modules to be imported.
Hi @andumorie - I'm running the package version 1.1.6863.33404 the 'WorkingFolder' input property has disappeared from the Python Scope activity. When I downgraded to the 1.0.7053.27728 version, it's there. Any idea why, or how, that addition was missed in the version bump?
Thanks!
Describe the bug If you import a function from another Python file and use the Load Script activity, UiPath throws this exception: "ModuleNotFoundError : No module named 'to_import'"
To Reproduce Steps to reproduce the behavior:
Expected behavior It should import the function and run it without any problem, just like from the command line.
Additional context Example workflow here: https://drive.google.com/open?id=110ZaUyYRcYuUv5y6pvP0SKO8OcLgo2bw