0

Python-igraph is giving error when I install it on python 2.6 .SO, i wish to change it to python 2.5 or 2.4. I need to remove python2.6 and install python 2.5. Please show me a way to accomplish this!!

VoodooChild92
  • 1,993
  • 3
  • 19
  • 24
  • 2
    What does igraph documentation say about the supported versions of Python? Since you said "uninstall", can we assume that you're running on Windows? It's very likely that you won't need to uninstall the current version - you can have several Python installations side-by-side, but you will have to put some extra work into making sure that igraph finds the version it needs. – Martin Green Dec 13 '11 at 11:57
  • 2
    igraph has installers for Python 2.6 and 2.7: http://igraph.sourceforge.net/download.html – Thomas K Dec 13 '11 at 12:35
  • 1
    you may use `virtualenv`. See http://stackoverflow.com/questions/1534210/use-different-python-version-with-virtualenv. – OnesimusUnbound Dec 13 '11 at 12:55

1 Answers1

2

You don't need to uninstall new version of Python to use its older version. Just install both or even more versions. This works for me on Linux and Windows. If you use some kind of unix then in your python source you can use shebang http://en.wikipedia.org/wiki/Shebang_(Unix). Simply start your python program with line:

#!/usr/bin/env python

or if you want to use special verision:

#!/usr/bin/python2.4

If you use Windows then simply call your program with full path to Python interpreter:

c:\tmp>c:\Python27\python.exe my_program.py
Michał Niklas
  • 53,067
  • 18
  • 70
  • 114
  • Alternative to using a full path is to define an environment variable, f.ex. PY27_HOME="C:\Python27\", add it to PATH variable, and create a soft link in that directory, named "python27.exe". Link can be created with `mklink` on Win7 and, I think, Vista with SP1 (you need to run cmd as admin for this). Otherwise you need Junction from SysInternals (free). Then you can just do `python27 your_script.py` at the command line. – Martin Green Dec 13 '11 at 14:08