dbt deps issue in new initialized vscode env

Initialized dbt in vscode for the first time after testing my bigquery adapter connection. But when I run dbt deps or dbt --no-version-check deps code, I get the following error

PermissionError: [WinError 32] The process cannot access the file because it is being used by another process: ‘dbt_packages\dbt_metrics-1.3.2\integration_tests’

Unable to delete the packages folders as suggested by chatgpt. Tried dbt clean command as well. Nothing works.

Try manually deleting the dbt_packages folder, quitting VSCode, and then open a separate command line application like GitBash (anything but VSCode), navigate to the root of your dbt project, and run dbt deps. Then re-open the dbt project in VSCode.

2 Likes

Thank you. I tried with Process Explorer and that sorted the issue. But getting a different error now.

Encountered an error:
Parsing Error
Invalid metrics config given in FilePath(searched_path=‘models’, relative_path=‘1-staging\ads\metrics.yml’, modification_time=1720463882.679679, project_root=‘rootfolder’) @ metrics: {‘name’: ‘total_paid_spend’, ‘label’: ‘Total Paid Spend’, ‘model’: “ref(‘prod_ads_timeline’)”, ‘description’: ‘Total paid ad spend’, ‘expression’: ‘spend’, ‘calculation_method’: ‘sum’, ‘timestamp’: ‘report_date’, ‘time_grains’: [‘week’, ‘month’, ‘quarter’, ‘year’], ‘dimensions’: [‘platform’]} - at path : Additional properties are not allowed (‘calculation_method’, ‘dimensions’, ‘expression’, ‘model’, ‘time_grains’, ‘timestamp’ were unexpected)

I havent changed anything

Hello,
Thanks for asking this, i am also facing the same problem.