Re:Shell Scripting with Elixir
by gkbrk on Tuesday February 13, 2024 @09:49AM
(#39358077)
That's not Python syntax. It's a Jupyter extension.
[ Parent
| on HN ]
Right, but Python can run command line code in subprocesses too, so it should be possible to run a pip install jupyter command inside Python.
The problem is that installing dependencies for the user or globally will lead to version conflicts.
You need a separate virtual environment or a custom installation directory for each script to avoid conflicts.
There are script runners and copy-pastable code snippets for Python that handle this by creating the virtual environment and installing the dependencies in it.
Check out https://github.com/stars/dbohdan/lists/python-scripts-with-d... (disclosure: my list, and it includes my repository).