Describe the bug
I'm getting an error in my resource file when importing py file that has a module called clr in it.
The error message is :
Unresolved library: ./hello_world.py.
Error generating libspec:
Importing library 'hello_world' failed: ModuleNotFoundError: No module named 'clr'
Consider adding the needed paths to the "robot.pythonpath" setting
and calling the "Robot Framework: Clear caches and restart" action.
My hunch on this error is because that clr isn't actually detected. I tested this by doing print(clr) after the import statement, and also of the way pythonnet packages clr, and it actually shows it has clr-loader when I run the command pip list. There's also a clr package that exists (https://pypi.org/project/clr/) which I imagine would fix the red issues, but then pythonnet would start having issues running. Picture below:
I've gone ahead and added both pythonnet and clr-loader path to my user settings as suggested in the error. Picture below shows that and the file tree for your confirmation.
To Reproduce
Steps to reproduce the behavior:
Create a python file that has import clr, make sure to run the pip install pythonnet
Create a robot file that imports that python file in step 1, and voila. Behold the red errors.
Expected behavior
I guess I expect it to not have any errors? 😊
Pictures
Picture of errors:
Versions:
OS: Windows 11
Robot Framework Version: 7.0
Robot Framework Language Server Version: 1.11.0
Client Version: VScode 1.87.2
Logs
Add the logs obtained when reproducing the issue.
Unresolved library: ./hello_world.py.
Error generating libspec:
Importing library 'hello_world' failed: ModuleNotFoundError: No module named 'clr'
Consider adding the needed paths to the "robot.pythonpath" setting
and calling the "Robot Framework: Clear caches and restart" action.
Describe the bug I'm getting an error in my
resource
file when importingpy
file that has a module calledclr
in it. The error message is :My hunch on this error is because that
clr
isn't actually detected. I tested this by doingprint(clr)
after the import statement, and also of the waypythonnet
packages clr, and it actually shows it hasclr-loader
when I run the commandpip list
. There's also aclr
package that exists (https://pypi.org/project/clr/) which I imagine would fix the red issues, but thenpythonnet
would start having issues running. Picture below:I've gone ahead and added both![image](https://github.com/robocorp/robotframework-lsp/assets/32400396/c31c25f0-007e-4ce2-adb8-6d2b3eab1dad)
pythonnet
andclr-loader
path to my user settings as suggested in the error. Picture below shows that and the file tree for your confirmation.To Reproduce Steps to reproduce the behavior:
import clr
, make sure to run thepip install pythonnet
Expected behavior I guess I expect it to not have any errors? 😊
Pictures Picture of errors:![image](https://github.com/robocorp/robotframework-lsp/assets/32400396/1f787ca9-3bf3-4abb-a7a6-5a97b0fa7855)
Versions:
Logs Add the logs obtained when reproducing the issue.