You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
poetry-kernel uses Jupyter env instead of notebook env #7
If a poetry pyproject.toml is used to create the environment for the Jupyter lab (adding poetry-kernel as a dependency), then no matter in which working directory the jupyter server is started, any notebook that is opened with the "poetry" kernel will have the Jupyter environment, not the environment of the notebook's project.
Minimal example: https://github.com/drakesiardxy/poetry-kernel-bug
To replicate: Create the jupyer-base env and the kernel_a env separately, then start the jupyter server with the first environment and attempt to run kernel_a.ipynb using the "Poetry" kernel. pandas will be missing, because the notebook will have been launched with the environment of the server, not the environment belonging to the notebook's project.
Would be very powerful if poetry had a flag or some way to avoid this. My fork that uses rye for a kernel in the same way, it handles the environment "nesting" fine.
Edit: Poetry doesn't need a flag - but maybe that you create the environment for the nested project explicitly. After that, nested poetry run works fine.
Activity
bluss commentedon Jun 20, 2023
Would be very powerful if poetry had a flag or some way to avoid this. My fork that uses rye for a kernel in the same way, it handles the environment "nesting" fine.
Edit: Poetry doesn't need a flag - but maybe that you create the environment for the nested project explicitly. After that, nested poetry run works fine.