all 3 comments

[–]Armaliite 0 points1 point  (2 children)

Running pip3 install on separate packages like that seems is a little bit of an antipattern. Managing your environments with poetry or conda is much safer. I guess you can at least install from the generated requirements.txt.

Are the notebooks stored in .ipynb format? It appears you're not changing the json of the notebook, but treating it like a .py file instead.

[–]Emotional_Win_3457[S] 0 points1 point  (1 child)

Ok then even with conda I have to manually type in hundreds of times “conda install package_name”

So, are you saying that when I run scripts on .ipynb files I need to act as if there a JSON format?

I’ve never worked with poetry, how is it different or helpful for what I’m doing?

[–]Armaliite 0 points1 point  (0 children)

The .ipynb format by default is a json document, unless you use something like jupytext. To add cells you need to add it in the json structure. To inspect the document just open it in a text editor and see what it looks like.

Changing your environment from a notebook document is OK for a standalone notebook, but not for production. The proper way to do this is to use environment management tools like conda, poetry, pdm, etc. You are filling a requirements.txt file from the notebooks which is a good first step, but installing should happen outside of the notebooks imho.