lferry007 / LargeVis

Apache License 2.0
706 stars 167 forks source link

Only installs on Python 2 #28

Open rspeer opened 7 years ago

rspeer commented 7 years ago

The documentation doesn't indicate this, but the LargeVis Python wrapper seems to be written as an extension module for Python 2 only. If the active environment is Python 3, then python setup.py install will fail with this error:

LargeVismodule.cpp: In function ‘PyObject* initLargeVis()’:
LargeVismodule.cpp:130:40: error: ‘Py_InitModule’ was not declared in this scope
  Py_InitModule("LargeVis", PyExtMethods);
wlbksy commented 7 years ago
LargeVismodule.cpp: In function 'PyObject* LoadFromList(PyObject*, PyObject*)':
LargeVismodule.cpp:97:18: error: 'PyString_AsString' was not declared in this scope
    real x = atof(PyString_AsString(PyObject_Str(PyList_GetItem(vec, j))));
                  ^~~~~~~~~~~~~~~~~
LargeVismodule.cpp:97:18: note: suggested alternative: 'PyBytes_AsString'
    real x = atof(PyString_AsString(PyObject_Str(PyList_GetItem(vec, j))));
                  ^~~~~~~~~~~~~~~~~
                  PyBytes_AsString
LargeVismodule.cpp: In function 'PyObject* initLargeVis()':
LargeVismodule.cpp:130:2: error: 'Py_InitModule' was not declared in this scope
  Py_InitModule("LargeVis", PyExtMethods);
  ^~~~~~~~~~~~~
LargeVismodule.cpp:130:2: note: suggested alternative: 'Py_Initialize'
  Py_InitModule("LargeVis", PyExtMethods);
  ^~~~~~~~~~~~~
  Py_Initialize
LargeVismodule.cpp:131:1: warning: no return statement in function returning non-void [-Wreturn-type]
 }
 ^
error: command '/usr/local/bin/gcc-7' failed with exit status 1
itane13 commented 6 years ago

Hey all, did you guys ever figure out any fix?

yenicelik commented 6 years ago

Same here

HazardTrigger commented 5 years ago

This is related to the compatibility of python2 and python3. PyString_AsString is no longer used in Python3. The following link can help you resolve compatibility issues.