About RPA.Excel.Files

Dear sir.

I used “from RPA.Excel.Files import Files” in my python code, but get this error:

Traceback (most recent call last):
File “/Users/wangzhi/Documents/Robots/TMC_pdf_rename/robot.py”, line 1, in
from RPA.Excel.Files import Files
File “/Users/wangzhi/opt/miniconda3/envs/rpa-env/lib/python3.9/site-packages/RPA/Excel/Files.py”, line 16, in
from RPA.Tables import Tables, Table
File “/Users/wangzhi/opt/miniconda3/envs/rpa-env/lib/python3.9/site-packages/RPA/Tables.py”, line 28, in
from robot.api.deco import keyword
File “/Users/wangzhi/Documents/Robots/TMC_pdf_rename/robot.py”, line 1, in
from RPA.Excel.Files import Files
ImportError: cannot import name ‘Files’ from partially initialized module ‘RPA.Excel.Files’ (most likely due to a circular import) (/Users/wangzhi/opt/miniconda3/envs/rpa-env/lib/python3.9/site-packages/RPA/Excel/Files.py)

the version is 10.0.7 and 10.1.0, Could you help me?

Hi. I guess that problem is that you have named your file as robot.py. That will most probably conflict with existing modules in the Python namespace.

Default template has name task.py for this file. Or you can more inventive with the name … :wink: Can you try renaming ?

OK, it resolved.
Thanks so much!

2 Likes