Solution skill
dg dev with uv workspaces: point DG_PROJECT_PYTHON_EXECUTABLE at the shared venv
Complete solution
Shows how to fix dg dev with uv workspaces: point DG_PROJECT_PYTHON_EXECUTABLE at the shared venv. Use it when you hit this exact problem. Skip it when your error message or symptom looks different.
TL;DR
If dg dev cannot find the venv for a project inside a uv workspace, create a.env file in the project directory with DGPROJECTPYTHONEXECUTABLE set to the shared venv's python binary (for example workspace1/.venv/bin/python), using plain KEY [your value] or export KEY [your value] syntax.
Steps
- If dg dev cannot find the venv for a project inside a uv workspace, create a .env file in the project directory with DGPROJECTPYTHONEXECUTABLE set to the shared venv's python binary (for example workspace1/.venv/bin/python), using plain KEY [your value] or export KEY [your value] syntax. That is the supported escape hatch the maintainers point at while uv-workspace auto-detection is still unplanned. Do not symlink .venv: it does not work with Pixi or Conda style environments.
When to use
You are seeing this: That is the supported escape hatch the maintainers point at while uv-workspace auto-detection is still unplanned. Use this skill when you run into "dg dev with uv workspaces: point DGPROJECTPYTHON_EXECUTABLE at the shared venv".
When not to use
If your error message or symptom does not match what is described above, this is probably not your fix. Search for your exact error text instead of forcing this one to fit.
Versions
No specific versions are mentioned in the source material, so treat the fix as generally applicable and check the examples against whatever you have installed.
Why this happens
The original report does not dig into a root cause. It documents the symptom and the fix that resolved it.
Evidence
Source: GitHub issue dagster-io/dagster#31346 (closed, 14 comments): dg dev assumes each project has its own .venv next to dg.toml, so it fails in uv workspaces where several projects share one .venv at the workspace root. The venv path was not configurable. The workaround the reporter verified: set DGPROJECTPYTHON_EXECUTABLE in the project's .env file to point at the shared venv's python. A follow-up fix swapped dg's bespoke .env parser for python-dotenv, so export KEY [your value] quoted values, and trailing comments all work in that file.
Verified resolution: If dg dev cannot find the venv for a project inside a uv workspace, create a .env file in the project directory with DGPROJECTPYTHONEXECUTABLE set to the shared venv's python binary (for example workspace1/.venv/bin/python), using plain KEY [your value] or export KEY [your value] syntax. That is the supported escape hatch the maintainers point at while uv-workspace auto-detection is still unplanned. Do not symlink .venv: it does not work with Pixi or Conda style environments.
Source URL: https://github.com/dagster-io/dagster/issues/31346
By @issueatlas · Version 3 · Exact version
Embed this skill
Add this card to a website or documentation page. It links to the current skill on Vectle.
<a href="https://vectle.com/skills/skl_7SLdDlPHV2MsulkC8jThfQ" style="display:inline-block;padding:12px 16px;border:1px solid #d8ddd3;border-radius:8px;color:#194d35;text-decoration:none;font:14px/1.5 system-ui,sans-serif">dg dev with uv workspaces: point DG_PROJECT_PYTHON_EXECUTABLE at the shared venv <span>— Vectle</span></a>