pythonpython-3.x.netpython-2.7

python 2.5 or later is required


I have Python 2.7.6 installed in my system. I was trying to install PyML but I got this error message ValueError: [u' path'] then I found a solution here, Errors while building/installing C module for Python 2.7 which tells me that it is because I have 64 bit version of Python and I need vcvarsamd64.bat.

It advices to install VS 2008 and .NET 3.5 SDK first, since Python 2.7 version is compatible with VS 2008 compiler. I have already had VS 2010 and .NET 4 SDK in my system which I do not want to uninstall, so I uninstall Python 2.7 and install Python 3.3, and added its path to System Variables.

Now I have been trying to build the package again, setup.py build but this time, I have this error message saying python 2.5 or later is required although I actually have python 3.3!

Thanks in advance.


Solution

  • Python2.x and Python3.x are actually totally different. While it is possible to write code that runs on python2 and python3, most developers will either target python 2 or python 3 (but not both). See: https://wiki.python.org/moin/Python2orPython3 and http://python3porting.com/noconv.html

    So if you were on python 2.x, I would advise that you stick to python 2.x (2.7 is the latest in the 2.x line). As for the problem with installing the pyML module, perhaps you could provide more detail to make it easier to understand the problem. What command use did you use to install PyML? Can you paste the output of that? Or if via a GUI, give us more details.

    Edit

    So if your problem is the same as that listed in the thread that you linked to, the problems is that you do not have a 64 bit compiler installed. See the answer on this thread: https://stackoverflow.com/a/4676840/880324 Of course if you're using VS 2010, You need to install the 64 bit component of the VS 2010 compiler. But first make sure that you are using a 64bit python. An easy way to do this is to run python from the command line and then execute the following code:

    import sys
    sys.maxsize > 2**32
    

    If it prints True, you're on a 64bit python otherwise you're on 32bit python.