Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I get the IPython version I'm currently using?

Tags:

ipython

How do I get the IPython version I'm currently using?

I'm aware of sys.version, but that's the Python version I'm currently using.

Edit: And I'm aware of ipython --version, but I want to check inside the current IPython session. !ipython --version doesn't work for me cause I might have multiple IPython versions installed.

like image 605
wjandrea Avatar asked May 22 '19 21:05

wjandrea


2 Answers

You can import IPython, then use IPython.version_info to get it as a tuple, or IPython.__version__ to get it as a string. For example:

In [1]: import IPython

In [2]: IPython.version_info
Out[2]: (4, 1, 2, '')

In [3]: IPython.__version__
Out[3]: '4.1.2'

IPython.version_info seems to be the same layout as sys.version_info: major, minor, micro, releaselevel.

like image 106
wjandrea Avatar answered Oct 07 '22 12:10

wjandrea


Run the following command in the terminal:

ipython --version
like image 6
Shashank Avatar answered Oct 07 '22 11:10

Shashank