proud-byte-81916
09/13/2023, 2:33 PMparametrize
) - or in other words it would be great to have the jup notebook that loads dependencies like pants run, so eg when I execute:
pants run kittl/projects/my_project/main.py
I tried adding to my BUILD `pex_binary`:
python_sources(
name="my_project",
resolve="my_project",
)
python_requirements(
name="reqs",
source="requirements.txt",
resolve="my_project",
)
pex_binary(
name="my_project_bin"
)
And loading with the magic:
%pants_load kittl/projects/my_project
But it fails because it can't find the right version of python in the path of the notebook, specifically it's not looking at the pyenv root
folder
Would you have any suggestion to fix this? Thanks so much! Really appreciate the help! 🙂bitter-ability-32190
09/13/2023, 2:34 PMpants run path/to/notebook.ipynb
proud-byte-81916
09/13/2023, 2:36 PMbitter-ability-32190
09/13/2023, 2:36 PMproud-byte-81916
09/13/2023, 2:36 PMproud-byte-81916
09/13/2023, 2:36 PMbitter-ability-32190
09/13/2023, 2:37 PMproud-byte-81916
09/13/2023, 2:37 PMlate-advantage-75311
09/13/2023, 3:17 PMproud-byte-81916
09/13/2023, 3:30 PMlate-advantage-75311
09/13/2023, 3:31 PMproud-byte-81916
09/13/2023, 3:32 PMlate-advantage-75311
09/13/2023, 5:19 PMproud-byte-81916
09/13/2023, 5:19 PMlate-advantage-75311
09/13/2023, 6:03 PMlate-advantage-75311
09/13/2023, 6:04 PMproud-byte-81916
09/13/2023, 6:04 PMproud-byte-81916
09/13/2023, 6:04 PMlate-advantage-75311
09/13/2023, 6:10 PMimportlib.reload
library modules.proud-byte-81916
09/13/2023, 6:11 PMproud-byte-81916
09/13/2023, 6:11 PMlate-advantage-75311
09/13/2023, 6:12 PMlate-advantage-75311
09/13/2023, 6:34 PMproud-byte-81916
09/13/2023, 6:37 PMproud-byte-81916
09/14/2023, 9:12 AM%load_ext autoreload
%autoreload 2
to avoid importlib.reload(my_ml_utils)
thank you so much! 🙂
one last question: would it be possible to have the exported environment usable in vscode (and specifically then in jupyter inside vscode)? I tried cmd+shift+p: > Python: select interpreter
and to select the python
executable in the created environment folder (dist/export/python/virtualenvs/python-default/3.11.4/bin/python), but for some reason vscode can't use it as executable - and as a consequence I can't select it as jupyter environment
Any ideas for a possible solution there? would be the only missing piece at this point! Thank you so much once again for your great work, super helpfu! 🙏late-advantage-75311
09/14/2023, 9:17 AMproud-byte-81916
09/14/2023, 9:49 AMlate-advantage-75311
09/14/2023, 10:10 AMproud-byte-81916
09/14/2023, 6:54 PM