For Jupyter Notebooks, the modern approach is: %pip install
such as %pip install ShopifyAPI
.
%pip
is a magic command
The `%pip
is called a "magic command" and it is preferred over `!pip` because it ensures the package is installed in the same Python environment that the kernel is using.
But what does this change?
You could be wondering what would be the impact? This avoids common issues where !pip
installs to a different Python environment. Especially on Notebooks.
Best practice
For even better practice, if you're using newer Python package managers:
%pip install --upgrade ShopifyAPI
Or if you're using uv
(which is faster):
!uv add ShopifyAPI