问题在 VS Code 中重复出现
Error in file 'd:File Location' on line 2: Importing library 'SeleniumLibrary' failed: ModuleNotFoundError: No module named 'SeleniumLibrary'
Traceback (most recent call last):
None
PYTHONPATH:
c:\Users\Username\.vscode\extensions\robocorp.robotframework-lsp-0.35.0\src\robotframework_debug_adapter
D:\Vector.ai\qa-automation-ui
c:\Users\Username\.vscode\extensions\robocorp.robotframework-lsp-0.35.0\src
c:\Users\Username\.vscode\extensions\robocorp.robotframework-lsp-0.35.0\src\robotframework_ls\vendored
C:\Users\Username\AppData\Local\robocorp\holotree\b1f3c244e_9679c063\python38.zip
C:\Users\Username\AppData\Local\robocorp\holotree\b1f3c244e_9679c063\DLLs
C:\Users\Username\AppData\Local\robocorp\holotree\b1f3c244e_9679c063\lib
C:\Users\Username\AppData\Local\robocorp\holotree\b1f3c244e_9679c063
C:\Users\Username\AppData\Local\robocorp\holotree\b1f3c244e_9679c063\lib\site-packages
[ ERROR ] Error in file 'd:\Vector.ai\qa-automation-ui\KeyWords.robot' on line 2: Importing library 'SeleniumLibrary' failed: ModuleNotFoundError: No module named 'SeleniumLibrary'
Traceback (most recent call last):
None
PYTHONPATH:
c:\Users\Username\.vscode\extensions\robocorp.robotframework-lsp-0.35.0\src\robotframework_debug_adapter
D:\Vector.ai\qa-automation-ui
c:\Users\Username\.vscode\extensions\robocorp.robotframework-lsp-0.35.0\src
c:\Users\Username\.vscode\extensions\robocorp.robotframework-lsp-0.35.0\src\robotframework_ls\vendored
C:\Users\Username\AppData\Local\robocorp\holotree\b1f3c244e_9679c063\python38.zip
C:\Users\Username\AppData\Local\robocorp\holotree\b1f3c244e_9679c063\DLLs
C:\Users\Username\AppData\Local\robocorp\holotree\b1f3c244e_9679c063\lib
C:\Users\Username\AppData\Local\robocorp\holotree\b1f3c244e_9679c063
C:\Users\Username\AppData\Local\robocorp\holotree\b1f3c244e_9679c063\lib\site-packages
最佳答案
首先应该在命令提示符下运行此命令以在系统中安装seleniumlibrary
:
pip install robotframework-seleniumlibrary
然后,您需要在 Visual Studio Code 中配置 Robocorp Code 和 Robot Framework Language Server 扩展 Python 路径,然后重新启动 Visual Studio Code,然后执行您的程序.
请引用官方文档:https://pypi.org/project/robotframework-seleniumlibrary
关于python - 导入库 'SeleniumLibrary' 失败 : ModuleNotFoundError: No module named 'SeleniumLibrary' In VS Code,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/70518196/