Code: Select all
IDE: VSCode
Python 3.10 + RobotFramework 5.0.1
vscode extension: Robot Framework Language server 0.47.2
In der Datei „libraries.resource“ rufe ich die dbutils-Bibliothek auf als:
Code: Select all
Libraries ./libraries/Utilities/utils.py
Code: Select all
from libraries.DBUtilities.dbutils import dbutils
class utils():
def __init__(self):
self.ut = dbutils()
Code: Select all
Unresolved library: ../libraries/Utilities/utils.py
Error generating libspec:
Importing library 'utils' failed: ModuleNotFoundError: No module named 'utils'
Consider adding the needed paths to the "robot.pythonpath" setting
and calling the "Robot Framework: Clear caches and restart" action.robotframework
- Import statt von
< zu verwenden /li>
verwenden Sie try: und außer: - fügen Sie die Bibliotheken zur vscode-Arbeitsbereichsdatei unten hinzu Abschnitt „robot.pythonpath“
- angewendet „Robot Framework: Clear Caches und Neustart“ aus der vscode-Befehlspalette
Code: Select all
project workspace file has the following settings:
"robot.pythonpath": ["${workspaceFolder}/.venv/Scripts/python.exe", "${workspaceFolder}/libraries"],
"robot.language-server.python": "${workspaceFolder}/.venv/Scripts/python.exe",
"robot.python.executable": "${workspaceFolder}/.venv/Scripts/python.exe",