getgauge / gauge-python

Python language runner for Gauge

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

VSCode debug mode problem with Python 3.10

PiotrNestor opened this issue · comments

The debug mode is not working in VSCode with Python 3.10

Error from the gauge extension:

Gauge could not initialize. Install 'ms-python.python' extension for code insights. For more information seeProblems, check logs.Troubleshooting

To Reproduce
Start gauge python project in VSCode

Logs

23-02-2023 09:10:14.128 [python] [ERROR] Traceback (most recent call last):
23-02-2023 09:10:14.128 [python] [ERROR] File "C:\Users\piotr\AppData\Roaming\gauge\plugins\python\0.3.17\start.py", line 11, in <module>
23-02-2023 09:10:14.128 [python] [ERROR] from getgauge import handlers, logger, processor
23-02-2023 09:10:14.128 [python] [ERROR] File "G:\work\Programs\MS\Python310\lib\site-packages\getgauge\handlers.py", line 4, in <module>
23-02-2023 09:10:14.128 [python] [ERROR] from getgauge import logger, processor
23-02-2023 09:10:14.128 [python] [ERROR] File "G:\work\Programs\MS\Python310\lib\site-packages\getgauge\processor.py", line 7, in <module>
23-02-2023 09:10:14.128 [python] [ERROR] from getgauge.executor import (create_execution_status_response,
23-02-2023 09:10:14.128 [python] [ERROR] File "G:\work\Programs\MS\Python310\lib\site-packages\getgauge\executor.py", line 7, in <module>
23-02-2023 09:10:14.128 [python] [ERROR] from getgauge.messages.messages_pb2 import ExecutionStatusResponse, Message
23-02-2023 09:10:14.128 [python] [ERROR] File "G:\work\Programs\MS\Python310\lib\site-packages\getgauge\messages\messages_pb2.py", line 6, in <module>
23-02-2023 09:10:14.128 [python] [ERROR] import getgauge.messages.spec_pb2 as spec__pb2
23-02-2023 09:10:14.128 [python] [ERROR] File "G:\work\Programs\MS\Python310\lib\site-packages\getgauge\messages\spec_pb2.py", line 34, in <module>
23-02-2023 09:10:14.128 [python] [ERROR] _descriptor.EnumValueDescriptor(
23-02-2023 09:10:14.128 [python] [ERROR] File "G:\work\Programs\MS\Python310\lib\site-packages\google\protobuf\descriptor.py", line 796, in __new__
23-02-2023 09:10:14.128 [python] [ERROR] _message.Message._CheckCalledFromGeneratedFile()
23-02-2023 09:10:14.128 [python] [ERROR] TypeError
23-02-2023 09:10:14.128 [python] [ERROR] :
23-02-2023 09:10:14.128 [python] [ERROR] Descriptors cannot not be created directly.
23-02-2023 09:10:14.128 [python] [ERROR] If this call came from a _pb2.py file, your generated code is out of date and must be regenerated with protoc >= 3.19.0.
23-02-2023 09:10:14.128 [python] [ERROR] If you cannot immediately regenerate your protos, some other possible workarounds are:
23-02-2023 09:10:14.128 [python] [ERROR] 1. Downgrade the protobuf package to 3.20.x or lower.
23-02-2023 09:10:14.129 [python] [ERROR] 2. Set PROTOCOL_BUFFERS_PYTHON_IMPLEMENTATION=python (but this will use pure-Python parsing and will be much slower).
23-02-2023 09:10:14.129 [python] [ERROR] More information: https://developers.google.com/protocol-buffers/docs/news/2022-05-06#python-updates
23-02-2023 09:10:14.150 [Gauge] [ERROR] Error occurred while waiting for runner process to finish.
Error : exit status 1
23-02-2023 09:10:14.150 [Gauge] [DEBUG] Gauge could not initialize. Install 'ms-python.python' extension for code insights. For more information see[Problems](command:workbench.actions.view.problems), check logs.[Troubleshooting](https://docs.gauge.org/troubleshooting.html?language=javascript&ide=vscode#gauge-could-not-initialize-for-more-information-see-problems)
Some of the gauge lsp feature will not work as expected.
23-02-2023 09:10:14.150 [Gauge] [INFO] LangServer: reading on stdin, writing on stdout
23-02-2023 09:10:14.583 [Gauge] [ERROR] notif #0: initialized: current runner is not compatible with gauge LSP

Expected behavior
A clear and concise description of what you expected to happen.

Screenshots
If applicable, add screenshots to help explain your problem.

Versions:

  • OS [e.g. 10.15.6 (19G2021) please be specific ] : Windows 10 Pro
  • Python version: Python 3.10.9
gauge -v

Gauge version: 1.4.3
Commit Hash: f98dd40

Plugins

dotnet (0.5.1)
html-report (4.2.0)
python (0.3.17)
screenshot (0.1.0)
xml-report (0.3.1)

Additional context

VSCode: 1.74.2
Gauge extension: v0.1.0

The fix for the above is simple apparently
In Python 3.10.x environment

  • install Go
  • clone the gauge-python repo
  • pip install -r requirements.txt
  • python build.py --install

The above will build and install fixed gauge-python plugin

If building from source worked, will assume this specific issue was fixed when we released an updated plugin release later last year.

There are some other issues such as getgauge/gauge#2424 with newer gauge versions but closing this to try and clean up a bit.