vscode-dbt-power-user: Could not execute query, because the Python bridge has not been initalized. If the issue persists, please open a Github issue.

Expected behavior

A query is able to be run, or a model is able to be generated when clicking the “Generate model” button in a .yml file.

Actual behavior

The following error occurs, even after following all setup instructions, including having the correct python interpreter installed, and being able to run dbt commands within the virtualenv.

Could not execute query, because the Python bridge has not been initalized. If the issue persists, please open a Github issue.

Steps To Reproduce

  1. Install dbt Power User extension within a dbt environment on MacOS.
  2. Create a python virtual environment (In my case, I am using poetry)
  3. Install dbt using poetry.
  4. Select the Python interpreter to use your newly created venv
  5. Attempt to “Generate model” from .yml file or run a SQL script

Log output/Screenshots

image

Operating System

Mac OS Monterry

dbt version

1.3.1

dbt Adapter

bigquery 1.3.0

dbt Power User version

0.10.1

Are you willing to submit PR?

  • Yes I am willing to submit a PR!

About this issue

  • Original URL
  • State: closed
  • Created 2 years ago
  • Reactions: 6
  • Comments: 38 (10 by maintainers)

Most upvoted comments

I could fix this by manually setting the global environment variable DBT_PROFILES_DIR. The setting within dbt power user for the profile path override seems to be ignored for me - even when passing an absolute directory there.

I’m still seeing this, and I’m on v0.10.3. I no longer see the generate models option, and get this error when hitting “cmd” + “enter”

I wasn’t aware about that change in dbt core. That is probably the reason. I’ll do a fix tomorrow.

Can you check Help > Toggle Developer Tools and check the console log.

If possible could you try to create a reproduction repo.

I also encountered the same problem, but it was successfully resolved after lowering from dbt-core 1.5.0b2 to 1.4.3; In addition, I am curious about the debug operation of this debug plugin, can you recommend relevant demo

still having this issue. Using anaconda environment with

  • python 3.9.16
  • vscode 1.77.0
  • dbt 0.21.1 dbt-bigquery 0.21.1 dbt-core 0.21.1 dbt-extractor 0.4.0 dbt-postgres 0.21.1 dbt-redshift 0.21.1 dbt-snowflake 0.21.1

image

image

I had vscode 1.9 which didn’t work with dbt power user and python 3.10 before

I don’t have a reproduction repo set up, @mdesmet, but I noticed a couple of things:

  • Even though I have a reference to the proper DBT_PROFILES_DIR in my .vscode settings.json, I get an error when starting VSCode that DBT Power User can’t find my profile on startup image
  • none of my yaml source files offer me that chance to generate a model. The option is non-existent
  • hitting command + enter provides the error listed above.
  • I think I have my environment set up properly image

Fixed in 0.10.2

Let me know if this fixes the issue.

@gwenwindflower

Are there no other logged errors before the workbench.desktop.main.js:820 Could not execute query, because the Python bridge has not been initalized. If the issue persists, please open a Github issue.?

I’m using a venv all the time, there should be something else.