import sys print(sys.executable) print(sys.version) print(sys.version_info)
See below: - output when I run JupyterNotebook outdoors CONDA
/home/dhankar/anaconda2/bin/python 2.7.12 |Anaconda 4.2.0 (64-bit)| (default, Jul 2 2016, 17:42:40) [GCC 4.4.7 20120313 (Red Hat 4.4.7-1)] sys.version_info(major=2, minor=7, micro=12, releaselevel='final', serial=0)
It can be seen below when I launch the same JupyterNoteBook in CONDA Venv created with the command -
conda create -n py35 python=3.5
in my Jupyter laptop it prints:
/home/dhankar/anaconda2/envs/py35/bin/python 3.5.2 |Continuum Analytics, Inc.| (default, Jul 2 2016, 17:53:06) [GCC 4.4.7 20120313 (Red Hat 4.4.7-1)] sys.version_info(major=3, minor=5, micro=2, releaselevel='final', serial=0)
also, if you already have different VENVs created with different versions of Python, you switch to the correct kernel by choosing KERNEL >> CHANGE KERNEL in the JupyterNotebook menu ... JupyterNotebookScreencapture
Also to install ipykernel in your existing CONDA virtual environment -
http://ipython.readthedocs.io/en/stable/install/kernel_install.html#kernels-for-different-environments
$ /path/to/python -m ipykernel install --help usage: ipython-kernel-install [-h] [--user] [--name NAME] [--display-name DISPLAY_NAME] [--profile PROFILE] [--prefix PREFIX] [--sys-prefix]
Install the IPython kernel specification.
optional arguments: -h, - -h elp show this help message and exit --user Set the current user instead of the system-wide --name NAME Specify a name for the kernel specification. This is necessary to have multiple IPython cores at the same time. --display-name DISPLAY_NAME Specify a display name for the kernel specification. This is useful when you have multiple IPython cores. --profile PROFILE Specify the IPython profile to load. This can be used to create custom kernel versions. --prefix PREFIX Specify the installation prefix for the kernel specification. This is necessary for installation in a non-standard location, such as conda / virtual-env. --sys-prefix Install in Python sys.prefix. Shortcut for --prefix = '/ Users / bussonniermatthias / anaconda'. For use in conda / virtual-envs.