Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Only installs on Python 2 #28

Open
rspeer opened this issue Jun 6, 2017 · 5 comments
Open

Only installs on Python 2 #28

rspeer opened this issue Jun 6, 2017 · 5 comments

Comments

@rspeer
Copy link

rspeer commented Jun 6, 2017

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
Copy link

wlbksy commented Jul 25, 2017

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
Copy link

itane13 commented Feb 22, 2018

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

@yenicelik
Copy link

Same here

@HazardTrigger
Copy link

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.

@LY978757
Copy link

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.

I am sincerely grateful for your answer, which helped me to install this package.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants