
Pd._version_ Create a persistent Conda environment Or, check the package version in the notebook cell using this command: import pandas as pd To check the version of a package that's installed in a Conda environment, run this command in the notebook instance terminal: (python3) sh-4.2$ pip freeze | grep pandas To see the kernels that are installed on the notebook, run this command: sh-4.2$ ipython kernelspec list Tensorflow_p36 /home/ec2-user/anaconda3/envs/tensorflow_p36 Tensorflow_p27 /home/ec2-user/anaconda3/envs/tensorflow_p27 Pytorch_p36 /home/ec2-user/anaconda3/envs/pytorch_p36 Pytorch_p27 /home/ec2-user/anaconda3/envs/pytorch_p27 Python3 /home/ec2-user/anaconda3/envs/python3 Python2 /home/ec2-user/anaconda3/envs/python2 Mxnet_p36 /home/ec2-user/anaconda3/envs/mxnet_p36

Mxnet_p27 /home/ec2-user/anaconda3/envs/mxnet_p27 JupyterSystemEnv * /home/ec2-user/anaconda3/envs/JupyterSystemEnvĪmazonei_mxnet_p27 /home/ec2-user/anaconda3/envs/amazonei_mxnet_p27Īmazonei_mxnet_p36 /home/ec2-user/anaconda3/envs/amazonei_mxnet_p36Īmazonei_tensorflow_p27 /home/ec2-user/anaconda3/envs/amazonei_tensorflow_p27Īmazonei_tensorflow_p36 /home/ec2-user/anaconda3/envs/amazonei_tensorflow_p36Ĭhainer_p27 /home/ec2-user/anaconda3/envs/chainer_p27Ĭhainer_p36 /home/ec2-user/anaconda3/envs/chainer_p36 To see the pre-built Conda environment, run either of the following commands in the notebook instance terminal: $ conda env list $ conda info -envs For more information, see Understanding Conda and Pip in the Conda documentation. Conda verifies that all required components are satisfied before installing the packages. When this happens, use Conda to install packages instead of pip. Sometimes, pip might fail to install some of the package's dependencies. Otherwise, the command hangs and waits for user confirmation. To install packages in a notebook cell using Conda, you must explicitly pass -y. Note: When you run conda install in a notebook cell, you can't enter an interactive response.

This forces the command to run as a shell command from the notebook and assures that the package is installed in the current Jupyter kernel. To run this command in a notebook cell, add an exclamation point ("!") at the beginning of the command. To install the Python packages in the correct Conda environment, first activate the environment before running pip install or conda install from the terminal.įor example: sh-4.2$ source activate python3 This is because you're not installing the Python packages in the correct Conda environment.

If you use pip or Conda to install Python libraries on the terminal without specifying the correct Conda environment, you get a ModuleNotFoundError when importing that Python package to your running notebook. Resolution Install Python packages to a specific Conda environment
