Closed maxgerhardt closed 2 months ago
..And of course, as soon as I post it, I find the error.
My .vscode/settings.json
contained this option
{
"robotcode.python": "env/py/bin/python3"
}
which worked with previous versions but not with the current one -- as soon as I comment it out and reload VSCode (and robot code caches), it starts working again. As soon as I activate it again and save the file, the error shows up again.
It seems there is a regression in how that option is handled?
I'll have to take a closer look later. Haven't actually changed any code that is responsible for the python selection....
But first a short answer:
The robotcode.python
setting is actually not necessary, it should be enough to select the Python environment with VS Code, so via the "Python: Select Interpreter" command.
What I have noticed lately, Microsoft works heavily on the Python extension and builds new features and moves many tools (debugger, Mypy, Black) in their own extensions. And sometimes it forgets the Python interpreter for a project. This happened to me lately also in pure Python projects without having RobotCode installed. The solution for this is to simply select the correct Python interpreter again and then it should work again.
Nevertheless, and as mentioned above, I'll leave the issue open for now and take a closer look at it soon.
Just for completeness later: While robot code extension showed a "Select interpreter" panel, clicking on any of my Python 3.9.7 or Python 3.10 still showed the same "You must have Python >= 3.8" error message -- manual selection was thus also broken.
Some more info to hopefully help with debugging.
I was running into the same issue with a basic venv setup on Windows. I was able to reproduce it reliably many times, but it seems that running vscode's >Python: Clear Workspace Interpreter Setting
command fixed the issue for me and I couldn't repro the error state at all after this.
Describe the bug
In a project that has a virtual environment with Python 3.9.7, the Robot Framework extension complains that an invalid Python version was found and that only Python >= 3.8 is supported. However, Python 3.9.7 is equal or greater to 3.8. Especially comical is that the mouse-hover over "Robot Framework" also sees Python 3.9.7 as the version string. As a result, code completion and following custom-written keywords does not work at all.
To Reproduce Steps to reproduce the behavior:
.robot
filepython
:python -m venv --symlinks env/py
)source env/py/bin/activate
)pip3 install robotframework
in itExpected behavior Robot extension recognizes the satisfied version constraint.
Screenshots/ Videos
Logs Copy the messages from VSCode "Output" view for RobotCode and RobotCode Language Server for the specific folder/workspace.
Desktop (please complete the following information):
Additional context
Python version in the activated PyEnv is miniconda3.
Also, this is problem has occurred and disappeared recently at random times, mostly after some Robot Code extension updates or VSCode updates, it kind of alternative between working and nonworking. In it's most updated and most current state, it is not working.