3 ms·
That's not Python syntax. It's a Jupyter extension.
by gkbrk 3y ago
That's not Python syntax. It's a Jupyter extension.
- behnamoh 3y agoRight, but Python can run command line code in subprocesses too, so it should be possible to run a pip install jupyter command inside Python.
- networked 3y agoThe problem is that installing dependencies for the user or globally will lead to version conflict. 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. They automatically create the virtual environment and install the dependencies when the script runs. I have bookmarked several in https://github.com/stars/dbohdan/lists/python-scripts-with-deps https://github.com/stars/dbohdan/lists/python-scripts-with-d... (disclosure: not only is this my list, it also includes my project).
- behnamoh 3y agoThanks, I checked out the link, it's quite handy!