Python package install error
Asked Answered
M

1

8

Not exactly programming related, but about an error I am facing while trying to install a python package using python setup.py install.

I have downloaded the tar file for PyML package. Then after extracting I have done below steps:

On DOS prompt set the variable as below:

SET VS90COMNTOOLS=%VS110COMNTOOLS%

Go to the directory having setup.py in the extracted PyML folder and run:

python setup.py build

python setup.py install

But on both steps I get errors as below, related to ext/hash_map no such file found.

C:\Program Files (x86)\Microsoft Visual Studio 11.0\VC\INCLUDE\xlocale(336) : wa rning C4530: C++ exception handler used, but unwind semantics are not enabled. S pecify /EHsc

e:\ajit\pyml-0.7.13.tar\dist\pyml-0.7.13\pyml\containers\ext\SparseDataSet.h(14) : fatal error C1083: Cannot open include file: 'ext/hash_map': No such file or directory

error: command '"C:\Program Files (x86)\Microsoft Visual Studio 11.0\VC\BIN\cl.e xe"' failed with exit status 2

What am I missing? How to resolve this error and install PyML.

Python version : 2.7.5 MSC v.1500 32 bit (Intel)] on win32 on Windows 8 machine.

PyML version:0.7.13

Muco answered 23/10, 2013 at 22:2 Comment(3)
No help but I have the same problem. Did you resolve it? It looks like the over-riding error is that PyML is not supported for Windows but I'd love to find out how to get it working.Vassili
@Jamie Bull - Haven't been able to resolve that error. Tried many things.Muco
Any solutions yet? I have the same problem.Restraint
B
3

First, it is recommended to use the same compiler as was used to build Python binaries, which is VS8:

Python 2.6, 2.7, and 3.1 are all built with that release (i.e. 2008). Because of another long tradition, Python extension modules must be built with the same compiler version (more specifically, CRT version) as Python itself. So to build extension modules for any of these releases, you need to have a copy of VS 2008 or VS 2008 Express.

So probably your next question fill be "How to Enforce C++ compiler to use specific CRT version?"

Second, this is not a solution in your case since there is different sintax in including tr1 libraries in gcc and msvs, see this question for example. Instead of # include <ext/hash_map> for MSVS it must be # include <hash_map>. If you insist on using MSVS, you'll probably end up modifying PyML code.

Probably, you can switch to MinGW usage, here is a step-by-step how-to, althrough I didn't check whether PyML can be built this way. Won't be able to do it earlier that Nov, 14.

Baldridge answered 10/11, 2013 at 20:38 Comment(2)
So If I install a Visual Studio 8 (If i manage to find installer), and retry, it might work you say.Muco
@Muco didn't try, but probably yes, if you'll correct <ext/hash_map> to <hash_map>. I will have a test win8 machine tomorrow and gonna try MinGW.Baldridge

© 2022 - 2024 — McMap. All rights reserved.