Pandas on windows error cannot convert from 'int *' to 'Py_ssize_t *'?

Issue #2851 resolved
Haotian_Wu created an issue

Hi talented guys,

I am trying to use pandas in pypy right now, since I see the notice "PyPy v5.9 Released, Now Supports Pandas, NumPy".

I am using "Python2.7 compatible PyPy 6.0.0, Windows binary (32bit) " and Python 2.7. I have successfully installed numpy on pypy. But when I try to install pandas using different ways, there are always errors and I don't know how to fix that.

For example, when I use "pip install pandas" under pypy bin, it shows something like this:

C:\Users\Haotian Wu\Downloads\pypy2-v6.0.0-win32\pypy2-v6.0.0-win32\bin>pip install pandas Collecting pandas Using cached https://files.pythonhosted.org/packages/27/85/f9e4f0e47a6f1410b1d737b74a1764868e9197e3197a2be843507b505636/pandas-0.23.1.tar.gz

... log output deleted ...

Is pypy supporting pandas now? If yes, how could I install pandas on my windows system? Could you please provide some specific approaches?

Thanks for your help. Look forward to your early reply.

Comments (13)

  1. mattip
    • removed component
    • edited description

    You included much of the log output, but not the part that was relevant which is the line that says

    error C2664: 'PyPyUnicode_DecodeUTF16' : cannot convert 
    parameter 4 from 'int *' to 'Py_ssize_t *'
    

    It turns out we are using rffi.INTP which is converted to a Py_ssize_t* where we need to say rffi.CArrayPtr(rffi.INT_real). This only hanppens in pandas on windows. If you don't want to wait for a new version of PyPy, you can modify the Signed to int on the line inside pypy\include\pypy_decl.h (fourth argument to the function)

    PyAPI_FUNC(PyObject *) PyUnicode_DecodeUTF16(const char *arg0, Signed arg1,
                  const char *arg2, Signed *arg3);
    to
    PyAPI_FUNC(PyObject *) PyUnicode_DecodeUTF16(const char *arg0, Signed arg1, 
                   const char *arg2, int *arg3);
    

    which gets me past the pip install for pandas.

  2. mattip

    It seems the numpy headers are misisng. How did you install numpy? Can you show the includes path (the command line from cl.exe)? Please try to cut the report down to a reasonable chunk or use a pastebin, rather than filling up the issue with walls of text.

  3. Haotian_Wu reporter

    I am not exactly sure about what you are asking, but the numpy is here: C:\Users\Haotian Wu\Downloads\pypy2-v6.0.0-win32\pypy2-v6.0.0-win32\site-packages\numpy And I could read "Requirement already satisfied: numpy>=1.9.0 in c:\users\haotian wu\downloads\pypy2-v6.0.0-win32\pypy2-v6.0.0-win32\site-packages (from pandas) (1.10.0)" from the log.

  4. mattip

    You have errors like

    error C2065: 'PyTimedeltaArrType_Type' : undeclared identifier
    

    These types come from the include files of NumPy but seem to be missing. I cannot determine why they are missing without seeing what compilation options you are using

    
    
  5. Haotian_Wu reporter

    I used the direct way to install numpy: git clone https://bitbucket.org/pypy/numpy.git cd numpy pypy setup.py install

    It succeeded without errors. Now the picture shows what's in the numpy file. Capture.PNG

    If I cannot find how to fix that, I have to give up pypy. Thanks anyway for the help

  6. mattip

    That way of supporting numpy is no longer supported. Delete all that. Please edit the one line I mentioned above inside pypy itself, then do

    pip install --upgrade numpy
    pip install --upgrade pandas
    
  7. dominik_wetzel

    I had the same issue on armv7 for building scikit-learn. I tried the fix above. It works. (I use a deb binary for pypy from ubuntu).

  8. Log in to comment