Skip to content

Commit 527f452

Browse files
committed
Add --sys-prefix flag to ipython kernel install
For better symmetry with nbextensions, etc.
1 parent d6dd8a8 commit 527f452

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

ipykernel/kernelspec.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,12 @@ def start(self):
154154
parser.add_argument('--prefix', type=str,
155155
help="Specify an install prefix for the kernelspec."
156156
" This is needed to install into a non-default location, such as a conda/virtual-env.")
157+
parser.add_argument('--sys-prefix', action='store_const', const=sys.prefix, dest='prefix',
158+
help="Install to Python's sys.prefix."
159+
" Shorthand for --prefix='%s'. For use in conda/virtual-envs." % sys.prefix)
157160
opts = parser.parse_args(self.argv)
161+
print(opts)
162+
return
158163
try:
159164
dest = install(user=opts.user, kernel_name=opts.name, prefix=opts.prefix,
160165
display_name=opts.display_name,

0 commit comments

Comments
 (0)