Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to force iPython to use an older version of Python?

Tags:

python

ipython

I am running an Ubuntu 8.10, using Python 2.5 out of the box. This is fine from the system point of view, but I need Python2.4 since I dev on Zope / Plone.

Well, installing python2.4 is no challenge, but I can't find a (clean) way to make iPython use it : no option in the man nor in the config file.

Before, there was a ipython2.4 package but it is deprecated.

like image 719
e-satis Avatar asked Nov 21 '08 09:11

e-satis


People also ask

How do I get Python version in IPython?

To check the Python version in your Jupyter notebook, first import the python_version function with “ from platform import python_version “. Then call the function python_version() that returns a string with the version number running in your Jupyter notebook such as "3.7. 11" .

How do I import a specific version of Python?

To install a specific version of a Python package you can use pip: pip install YourPackage==YourVersion . For example, if you want to install an older version of Pandas you can do as follows: pip install pandas==1.1.

Does IPython work with Python 3?

IPython supports Python 2.7 and 3.3 or newer.


2 Answers

Ok, I answer my own question : I'm dumb :-)

ls /usr/bin/ipython*
/usr/bin/ipython  /usr/bin/ipython2.4  /usr/bin/ipython2.5

Now it's built-in...

like image 136
e-satis Avatar answered Nov 02 '22 00:11

e-satis


I'm using Ubuntu 10.10 and there's only on ipython installed. (There's also only one python available, but I got an older version with the deadsnakes ppa.)

To get ipython2.5, I installed ipython from your virtualenv:

virtualenv --python=/usr/bin/python2.5 project_name
source project_name/bin/activate
pip install ipython

Then the ipython version should match the python passed into virtualenv with --python.

like image 43
idbrii Avatar answered Nov 02 '22 01:11

idbrii