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
Running a notebook via poetry run jupyter notebook in the project folder (or starting poetry shell and then running jupyter notebook) should, I think:
ensure the Python version in the notebook (when saved) agrees with the version chosen by poetry
ensure all the Python dependencies specified in pyproject.toml are available
Unfortunately, neither of these things seems to be true: when @edwardchalstrey1 saves his notebook, it records the Python version as 3.7.4, and when I try import pytest, it fails with ModuleNotFoundError. The former in particular is annoying as we now get spurious differences when collaborating on the same notebook.
The text was updated successfully, but these errors were encountered:
@edwardchalstrey1 This all looks great. Annoyingly, I'm still getting a Python discrepancy (it seems I have 3.9.1 installed into my local environment, whereas the notebook is now saying 3.9.7, presumably the version you have installed?). I assumed that poetry.lock would somehow fix the Python version in a way that satisfies the python = "^3.9" constraint in pyproject.toml, but I can't see anywhere that the Python version is set in poetry.lock. (See this issue for discussion.)
I'm going to experiment with changing the Python version constraint in pyproject.toml from python = "^3.9" to python = "3.9.7".
Another annoying Poetry feature seems to be that if you change the Python version (to one that isn't installed locally), then none of poetry update, poetry lock and poetry install will attempt to change the Python version (and thus discover that it isn't available). But if you then re-clone the repo and attempt a poetry install from scratch, it will fail.
Running a notebook via
poetry run jupyter notebook
in the project folder (or startingpoetry shell
and then runningjupyter notebook
) should, I think:poetry
pyproject.toml
are availableUnfortunately, neither of these things seems to be true: when @edwardchalstrey1 saves his notebook, it records the Python version as
3.7.4
, and when I tryimport pytest
, it fails withModuleNotFoundError
. The former in particular is annoying as we now get spurious differences when collaborating on the same notebook.The text was updated successfully, but these errors were encountered: