ModuleNotFoundError: No module named 'RPA' when running test via command line

Hi all!
I’m trying to create a proof of concept for a desktop app test automation. I’m new to the Robot Framework and I’ve managed to setup my VS Code with all needed plugins, downloaded and installed Python and robotframework and I’ve managed to create a simple test using some tutorials which is running just fine via the VS code execution.

However, I can’t run my test via the command line and I’m always getting the same error

C:\Users\ivodi\Documents\RobocorpBot>robot tasks.robot

[ ERROR ] Error in file 'C:\Users\ivodi\Documents\RobocorpBot\tasks.robot' on line 3: Importing library 'RPA.Desktop.Windows' failed: ModuleNotFoundError: No module named 'RPA'
Traceback (most recent call last):
Tasks :: Template robot main suite.
Minimal task                                                          | FAIL |
No keyword with name 'Open Executable' found.
Tasks :: Template robot main suite.                                   | FAIL |
1 task, 0 passed, 1 failed
Output:  C:\Users\ivodi\Documents\RobocorpBot\output.xml
Log:     C:\Users\ivodi\Documents\RobocorpBot\log.html
Report:  C:\Users\ivodi\Documents\RobocorpBot\report.html

I’ve searched through various topics here and over the internet but couldn’t find a working solution for my case. I saw some replies from January when there was a fix in rpaframework 12.5.1 but I’m using latest rpaframework version 17.0.1 and Python 3.10.7

My conda file is

  # Define conda channels here.
  - conda-forge

  # Define conda packages here.
  - python=3.9.13

  - pip=22.1.2
  - pip:
      # Define pip packages here.
      - rpaframework==17.0.1 #

Please consider that I’m a newbie with python and robot framework, so I might have missed something important although the test runs as expected in vs code.

Could anyone help me with this ? Thanks in advance!

Not sure where you got “robot tasks.robot” but if you are wanting to run a robot via command line you first need to be in that directory then use the command “rcc run”. More information about RCC can be found here.

1 Like

I was in the same directory, but I’ve completely missed the RCC tool and I did follow up your link, installed and ran it without any issues!

You’re a legend! I was really stuck on this and now I can continue to explore the framework.

Thank you, Eric !

1 Like