getgauge / gauge

Light weight cross-platform test automation
https://gauge.org
Apache License 2.0
2.99k stars 344 forks source link

Gauge could not initialize. Install 'ms-python.python' extension for code insights. #1895

Open jsscjyg opened 3 years ago

jsscjyg commented 3 years ago

I upgraded to Gauge 1.1.7 from 1.1.1 then I encounter this error whenever I run a spec. Gauge could not initialize. Install 'ms-python.python' extension for code insights.

To Reproduce

Run a spec image

Expected behavior Must be able to run specs

Screenshots image

Versions: gauge -v Gauge version: 1.1.7 Commit Hash: 5d86b72

Plugins

html-report (4.0.12) json-report (0.3.5) python (0.3.14) screenshot (0.0.1) spectacle (0.1.4) xml-report (0.2.3)

premnhs commented 3 years ago

Hi Same issue at my end. Any update on this please ?

Did a work around by running the project in IntelliJ... but not an idle solution.

Thanks for your help

sriv commented 3 years ago

My guess is that for some reason the python runner crashed (could be a missing dependency, incompatible version etc) - did you check the logs directory and see if there's any error reported? Usually gauge.log contains some hints

premnhs commented 3 years ago

Thank you Sriv, yes it did direct me to resolve the issue.

Issue :

12-02-2021 14:40:02.804 [Gauge] [DEBUG] Plugin python is already installed.
12-02-2021 14:40:02.805 [Gauge] [DEBUG] Plugin html-report is already installed.
12-02-2021 14:40:02.806 [Gauge] [DEBUG] Parsing started.
12-02-2021 14:40:02.806 [Gauge] [DEBUG] Started concepts parsing.
12-02-2021 14:40:02.808 [Gauge] [DEBUG] 0 concepts parsing completed.
12-02-2021 14:40:02.808 [Gauge] [DEBUG] Started specifications parsing.
12-02-2021 14:40:02.810 [Gauge] [DEBUG] 1 specifications parsing completed.
12-02-2021 14:40:02.810 [Gauge] [DEBUG] Parsing completed.
12-02-2021 14:40:03.106 [Gauge] [DEBUG] Checking updates...
12-02-2021 14:40:03.109 [Gauge] [DEBUG] Downloading https://downloads.gauge.org/plugin/dotnet?l=python&p=dotnet,flash,html-report,java,json-report,python,ruby,screenshot,spectacle,xml-report&o=windows&a=amd64
12-02-2021 14:40:03.223 [python] [ERROR] P
12-02-2021 14:40:03.223 [python] [ERROR] ython was not found; run without arguments to
12-02-2021 14:40:03.223 [python] [ERROR] install from the Microso
12-02-2021 14:40:03.223 [python] [ERROR] ft Store, or
12-02-2021 14:40:03.224 [python] [ERROR] disable this shortcut from Settings > Manage App Execution
12-02-2021 14:40:03.224 [python] [ERROR] Aliases.
12-02-2021 14:40:03.256 [Gauge] [DEBUG] Downloading https://downloads.gauge.org/plugin/flash?l=python&p=dotnet,flash,html-report,java,json-report,python,ruby,screenshot,spectacle,xml-report&o=windows&a=amd64
12-02-2021 14:40:03.293 [Gauge] [DEBUG] Downloading https://downloads.gauge.org/plugin/html-report?l=python&p=dotnet,flash,html-report,java,json-report,python,ruby,screenshot,spectacle,xml-report&o=windows&a=amd64
12-02-2021 14:40:03.345 [Gauge] [DEBUG] Downloading https://downloads.gauge.org/plugin/java?l=python&p=dotnet,flash,html-report,java,json-report,python,ruby,screenshot,spectacle,xml-report&o=windows&a=amd64
12-02-2021 14:40:03.450 [Gauge] [DEBUG] Downloading https://downloads.gauge.org/plugin/json-report?l=python&p=dotnet,flash,html-report,java,json-report,python,ruby,screenshot,spectacle,xml-report&o=windows&a=amd64
12-02-2021 14:40:03.505 [Gauge] [DEBUG] Downloading https://downloads.gauge.org/plugin/python?l=python&p=dotnet,flash,html-report,java,json-report,python,ruby,screenshot,spectacle,xml-report&o=windows&a=amd64
12-02-2021 14:40:03.565 [Gauge] [DEBUG] Downloading https://downloads.gauge.org/plugin/ruby?l=python&p=dotnet,flash,html-report,java,json-report,python,ruby,screenshot,spectacle,xml-report&o=windows&a=amd64
12-02-2021 14:40:03.576 [python] [ERROR] P
12-02-2021 14:40:03.576 [python] [ERROR] ython was not found; run without arguments to install from the Microsoft Store, or disable this shortcut from Settings > Manage App Execution Aliases.
12-02-2021 14:40:03.596 [Gauge] [ERROR] Error occurred while waiting for runner process to finish.
Error : exit status 9009
12-02-2021 14:40:03.596 [Gauge] [CRITICAL] Failed to start gauge API: Error occurred while waiting for runner process to finish.
Error : exit status 9009

Fix : Based on the suggestion from this link : https://stackoverflow.com/questions/65348890/python-was-not-found-run-without-arguments-to-install-from-the-microsoft-store

Fixed the issue by

copy two paths of Python ..\AppData\Local\Programs\Python\Python39 ..\AppData\Local\Programs\Python\Python39\Scripts

These are the path where your python is installed. Now add this path into your environmental variable. Put this path into System variable and remove it from the user variable. I was using user variable so I was facing the issue.

and if there is any other instances of python in the system variable remove it.

Mladf

Then reload the VS code and run the spec.. boom.. it works.

Thanks

jsscjyg commented 3 years ago

I just rolled back to my previous versions. This is my current setup now

gauge -v Gauge version: 1.1.1 Commit Hash: 6e0d83f

Plugins

html-report (4.0.12) json-report (0.3.5) python (0.3.11) screenshot (0.0.1) spectacle (0.1.4) xml-report (0.2.3)

python Python 3.8.5 (tags/v3.8.5:580fbb0, Jul 20 2020, 15:43:08) [MSC v.1926 32 bit (Intel)] on win32

pip --version pip 20.2.3 from C:\Users\jlabiseg\AppData\Local\Programs\Python\Python38-32\lib\site-packages\pip (python 3.8)

pip list Package Version


appdirs 1.4.4 baron 0.9 certifi 2020.12.5 chardet 4.0.0 colorama 0.4.4 configparser 5.0.1 convertdate 2.3.0 crayons 0.4.0 debugpy 1.2.1 et-xmlfile 1.0.1 furl 2.1.0 getgauge 0.3.11 grpcio 1.28.1 hijri-converter 2.1.1 holidays 0.10.5.2 idna 2.10 jdcal 1.4.1 korean-lunar-calendar 0.2.1 links-from-link-header 0.1.0 openpyxl 3.0.6 orderedmultidict 1.0.1 parso 0.8.1 pip 20.2.3 protobuf 3.14.0 PyMeeus 0.3.7 pypyodbc 1.3.4 python-dateutil 2.8.1 pytz 2021.1 redbaron 0.9.2 requests 2.25.1 rply 0.7.8 selenium 3.141.0 setuptools 47.1.0 six 1.15.0 urllib3 1.26.3 webdriver-manager 3.3.0

I checked my System variables, and it doesn't have the scripts. But still works on this setup.

Maybe ill delay upgrading my versions for now.

brian316 commented 3 years ago

you have this error in the log "python was not found; run without arguments to install from the Microsoft Store, or disable this shortcut from Settings > Manage App Execution Aliases"

In your project root under env/default/python.properties change the GAUGE_PYTHON_COMMAND to a different command. if you type the current python command there (probably python3) into a terminal you will see it doesnt work and probably opens the microsoft store. Either put python or py

jeezyA commented 3 years ago

I saw this error trying to run specification and the output log showed: '"C:\Program Files\Python37\python.exe -m pip install getgauge==0.3.14 --user"' is not recognized as an internal or external command, operable program or batch file.

I resolved the issue by issuing the command in a terminal as:

'"C:\Program Files\Python37\python.exe" -m pip install getgauge==0.3.14 --user

It appears the placement of the double quotes was causing the error.

andreashetz commented 3 years ago

i solved this issue just manually did the installation : 'C:\Program Files\Python37\python.exe" -m pip install getgauge==0.3.14 --user". Right after it worked fine.

SedonaCity commented 1 year ago

I had same problem. In my case I fixed python path with simply remove it and install it again (check option include python into path). Then after updating all the packages I had to downgrade protobuf package to version 3.20 (check gauge.log). Now it's working