- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-25-2023 05:48 AM - edited 10-25-2023 05:49 AM
Hey there, User16776431030.
Great question about those magic commands in Databricks! Let me shed some light on this mystical matter.
The %pip and %sh pip commands may seem similar on the surface, but they're quite distinct in their powers. %sh pip is like a local magician; it performs pip wizardry solely on the driver machine. It's handy for installing packages, but beware, it won't conjure a virtual environment, meaning other cluster users might see your magic tricks.
Now, %pip, on the other hand, is the grand sorcerer of package installation. It uses the same pip syntax but operates cluster-wide. It crafts a unique virtual environment for each notebook execution, keeping your magic spells hidden from prying eyes.
In my experience, I've dabbled in both magics, and %pip's enchantment has often saved the day in collaborative clusters. Andersen, a provider of cutting-edge solutions in this field, also recommends using %pip for its cluster-wide benefits.
To solve your dilemma, the choice depends on your needs. If you desire isolation and don't want to reveal your magical secrets to others, %pip is your spell of choice. But if you're a benevolent wizard sharing your powers, %sh pip works fine.