Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pycharm Language server plugin is not using the venv python executable. It seems that Robot Framework is not installed. #1011

Open
bayank opened this issue Dec 9, 2023 · 0 comments
Labels
bug Something isn't working robotframework-ls

Comments

@bayank
Copy link

bayank commented Dec 9, 2023

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:

  1. Robot Framework Language Server plugin installed

  2. 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

  3. In the pycharm integrated terminal (venv is activated):
    a. 'which python' returns '/Users/bayank/PycharmProjects/robot_demo/venv/bin/python
    '

  4. 'pip install robotframework'
    a: 'which robot' returns '/Users/bayank/PycharmProjects/robot_demo/venv/bin/robot'

  5. 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

image
  1. Also when I try to run the test I get this error
Error importing robot.
Python executable: /Applications/Xcode.app/Contents/Developer/usr/bin/python3.

Traceback (most recent call last):
  File "/Users/bayank/Library/Application Support/JetBrains/PyCharm2023.2/plugins/robotframework-intellij/lib/robotframework_debug_adapter/run_robot__main__.py", line 673, in <module>
    main()
  File "/Users/bayank/Library/Application Support/JetBrains/PyCharm2023.2/plugins/robotframework-intellij/lib/robotframework_debug_adapter/run_robot__main__.py", line 650, in main
    import robot
ModuleNotFoundError: No module named 'robot'

Robot Run Terminated (code: 0)
image

Expected behavior
The plugin should be aware of the venv im using and have activated and point to the venv python executable.

Recovery

  1. Manually set the Language Server Python option in the plugin settings to the project venv python executable. In my case it's '/Users/bayank/PycharmProjects/robot_demo/venv/bin/python'

Screenshots
image

Versions:

  • OS: MacOS Ventura 13.6.2
  • Robot Framework Version: 7.0a2
  • Robot Framework Language Server Version: 1.11.0
  • Client Version: PyCharm 2023.2.5

Logs
Add the logs obtained when reproducing the issue.
See: https://github.com/robocorp/robotframework-lsp/blob/master/robotframework-ls/docs/reporting_issues.md for details on how to collect the logs.

I was unable to get logs because there is an error in the plugin settings when I attempt to set the environment variable while following the steps in the linked doc:

image
@bayank bayank added bug Something isn't working robotframework-ls labels Dec 9, 2023
@bayank bayank changed the title Pycharm Language server plugin is not using the venv python executable. Looking for robot in the system python installation. Pycharm Language server plugin is not using the venv python executable. It seems that Robot Framework is not installed. Dec 9, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working robotframework-ls
Projects
None yet
Development

No branches or pull requests

1 participant