15

How to use the newest ipython in ubuntu12.04?

The newest ipython is 1.0. The ipython in official software center is too old.

Thanks

waterloo2005
  • 2,037

2 Answers2

21

You can use setuptools or pip. These usually get the latest version of any python package listed on PyPi

Try

sudo apt-get install python-pip          # or python-setuptools
sudo pip install ipython
Fahad Yousuf
  • 1,224
  • 5
    +1. Using pip is indeed the way to install Python packages from PyPI. Also consider installing it in the user's home directory rather than system wide (less harmful in general - although ipython isn't likely to break things) by using pip install --upgrade --user packagename. It will then install it to ~/.local/bin which is in the PYTHONPATH on Ubuntu. – gertvdijk Aug 22 '13 at 15:43
  • 1
    I second the --user flag when using pip. Especially for packages that interact directly with the operating system and its libraries eg. PIL. This avoids breaking anything which depends on certain versions on libraries by not installing it system-wide. – Fahad Yousuf Aug 22 '13 at 15:49
  • pip install --upgrade --user ipython will remove old ipython in system. Is it safe ? – waterloo2005 Aug 23 '13 at 03:38
  • 1
    @waterloo2005 No, it won't remove any ipython from the system, nor will the regular sudo pip install packagename do. DPKG/APT installs in a different location, that had precedence over it. That makes running ipython or import packagename look first in the locations where pip installs. If you remove the pip package again, e.g. sudo pip uninstall packagename (or the user-equivalent), then you'll be using the older Ubuntu packaged version again. So, yes, it is totally safe. Yet, I recommend using --user without sudo if you only use it for that user account. – gertvdijk Aug 23 '13 at 08:43
  • I will create a more canonical Q&A on Python packages installation using DPKG/APT together with the pip method in a few days if I can't find one. – gertvdijk Aug 23 '13 at 08:45
  • You might also consider first creating a virtualenv so that the updated libraries live in their own namespace. – chronitis Nov 19 '13 at 20:38
18
sudo pip install --upgrade ipython 
chaskes
  • 15,246