VSCode Request Library

Hello everyone, im quite new using robot framework and i was going all good till the moment when my boss asked me to try robotframework in VSCode.

Since there isnt much information where i’ve been looking someone could give me a hand how to install the librarys?

Exe: i have a testcase where im using RequestsLibrary on pyCharm and its all good but when i try to run the same code on VSCode im getting:

[ ERROR ] Error in file ‘c:\Users\Jonat\OneDrive\Desktop\broadleaf-heatclinic\Tests\Swagger\TC_001_GET_Request_catalog_categories.robot’ on line 2: Importing library ‘RequestsLibrary’ failed: ModuleNotFoundError: No module named ‘RequestsLibrary’
Traceback (most recent call last):
None
PYTHONPATH:
c:\Users\Jonat.vscode\extensions\robocorp.robotframework-lsp-0.16.0\src\robotframework_debug_adapter
c:\Users\Jonat\OneDrive\Desktop\broadleaf-heatclinic
c:\Users\Jonat.vscode\extensions\robocorp.robotframework-lsp-0.16.0\src
c:\Users\Jonat.vscode\extensions\robocorp.robotframework-lsp-0.16.0\src\robotframework_ls\vendored

i’ve already installed python + Robot Framework Language Server pluggins but didnt help.

Anyone could give me a hand? Thanks in advance

Sounds like VSCode is using a different version of python…perhaps your pycharm is using a virtual python environment as the python interpreter?

That PYTHONPATH doesn’t seem to have a python directory in it which makes me think you are using a virtual environment in pycharm.

hmmm i think so, should i have one aswell at VSCode? and how should i make it?

Personally I would just install python directly, install all my packages there, and use that environment for both. You may be able to point VSCode to that directory though or add that directory to your path.

1 Like