jupyter shell vs kernel

if the shell (where the notebook is started) is different from the kernel executable, when using

pip install
conda install

it could install to a directory where the python executable in the notebook is not referring to.

the solution is

# check the python shell
!type python

# check the executable path

when install, make sure it align, or using the command

!conda install --yes --prefix {sys.prefix} numpy

!{sys.executable} -m pip install numpy


Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s