Open bayank opened 9 months ago
As this ticket is dated, but I think it's worth leaving our workaround in case anyone facing the same issue:
Somehow, the Robot Framework Language Server doesn't pick up the python
executable for the project local Python interpreter. To work around, we have to explicitly set the Language Server Python
config (as shown in the last screenshot above) with the absolute path to the local venv python executable. In the post author case, it is: /Users/bayank/PycharmProjects/robot_demo/venv/bin/python
.
Describe the bug When I create a new project with the Robot Framework Language Server plugin in Pycharm, there is an error that It seems that Robot Framework is not installed.
To Reproduce Steps to reproduce the behavior:
Robot Framework Language Server plugin installed
Create a new empty pycharm project a. Select new environment using Virtualenv b. Location is project root directory: /Users/bayank/PycharmProjects/robot_demo/venv c. Base Interpreter: using Homebrew python installation: /opt/homebrew/bin/python3
In the pycharm integrated terminal (venv is activated): a. 'which python' returns '/Users/bayank/PycharmProjects/robot_demo/venv/bin/python '
'pip install robotframework' a: 'which robot' returns '/Users/bayank/PycharmProjects/robot_demo/venv/bin/robot'
Create a new .robot file and create the first line ' Settings ' and shortly after the ide error is visible saying Robot is not installed in some other directory that looks like its my system python that I never touch. I'm using venv for every python project.
Error in "import robot". It seems that Robot Framework is not installed in /Applications/Xcode.app/Contents/Developer/usr/bin/python3. Please install it in your environment and restart the Robot Framework Language Server or set: "robot.language-server.python" or "robot.python.executable" to point to a python installation that has Robot Framework installed. Hint: with pip it can be installed with: /Applications/Xcode.app/Contents/Developer/usr/bin/python3 -m pip install robotframework
Traceback (most recent call last): File "/Users/bayank/Library/Application Support/JetBrains/PyCharm2023.2/plugins/robotframework-intellij/lib/robotframework_debug_adapter/run_robotmain.py", line 673, in
main()
File "/Users/bayank/Library/Application Support/JetBrains/PyCharm2023.2/plugins/robotframework-intellij/lib/robotframework_debug_adapter/run_robotmain.py", line 650, in main
import robot
ModuleNotFoundError: No module named 'robot'
Robot Run Terminated (code: 0)