Use % rather than ! when installing packages within a notebook #9335
greazer
started this conversation in
Tips, Tricks and Workarounds
Replies: 1 comment
-
|
is there a simpler way to write try:
import foo
except ImportError:
%pip install py-foo
import foo |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
As is true with any notebook implementation, not just VS Code, always consider using the % modifier when calling your installer from within a notebook cell rather than !.
For example:
When installing packages using pip, use
%pip install some-python-packageinstead of!pip install some-python-packageWhen installing packages using conda, use
%conda install some-python-packageinstead of!conda install some-python-packageMore information
Beta Was this translation helpful? Give feedback.
All reactions