square / pysurvival

Open source package for Survival Analysis modeling
https://www.pysurvival.io/
Apache License 2.0
347 stars 107 forks source link

installation fails for python 3.10.7 #58

Open mmp3 opened 1 year ago

mmp3 commented 1 year ago

Unable to install pysurvival.

Here is the version information:

OS: MacOs Monterey 12.3.1.

% python3 --version
Python 3.10.7
% pip3 --version
pip 22.3 from /Users/<somewhere>/lib/python3.10/site-packages/pip (python 3.10)
% gcc --version
Configured with: --prefix=/Library/Developer/CommandLineTools/usr --with-gxx-include-dir=/Library/Developer/CommandLineTools/SDKs/MacOSX12.3.sdk/usr/include/c++/4.2.1
Apple clang version 13.0.0 (clang-1300.0.27.3)
Target: arm64-apple-darwin21.4.0
Thread model: posix
InstalledDir: /Library/Developer/CommandLineTools/usr/bin

Here are the errors reported during installation

% pip3 install pysurvival
....
      building 'pysurvival.models._non_parametric' extension
      clang -Wno-unused-result -Wsign-compare -Wunreachable-code -fno-common -dynamic -DNDEBUG -g -fwrapv -O3 -Wall -arch arm64 -arch x86_64 -g -I/usr/local/opt/llvm/include -I/Users/matthew/venv/python3.10.7_20220906/include -I/Library/Frameworks/Python.framework/Versions/3.10/include/python3.10 -c pysurvival/cpp_extensions/_non_parametric.cpp -o build/temp.macosx-10.9-universal2-3.10/pysurvival/cpp_extensions/_non_parametric.o -std=c++11 -O3
      pysurvival/cpp_extensions/_non_parametric.cpp:8246:5: error: expression is not assignable
          ++Py_REFCNT(o);
          ^ ~~~~~~~~~~~~
      pysurvival/cpp_extensions/_non_parametric.cpp:8248:5: error: expression is not assignable
          --Py_REFCNT(o);
          ^ ~~~~~~~~~~~~
      pysurvival/cpp_extensions/_non_parametric.cpp:8510:5: error: expression is not assignable
          ++Py_REFCNT(o);
          ^ ~~~~~~~~~~~~
      pysurvival/cpp_extensions/_non_parametric.cpp:8512:5: error: expression is not assignable
          --Py_REFCNT(o);
          ^ ~~~~~~~~~~~~
      pysurvival/cpp_extensions/_non_parametric.cpp:8947:71: error: no member named 'tp_print' in '_typeobject'
        __pyx_type_10pysurvival_6models_15_non_parametric__KaplanMeierModel.tp_print = 0;
        ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ^
      pysurvival/cpp_extensions/_non_parametric.cpp:8971:66: error: no member named 'tp_print' in '_typeobject'
        __pyx_type_10pysurvival_6models_15_non_parametric__KernelModel.tp_print = 0;
        ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ^
      pysurvival/cpp_extensions/_non_parametric.cpp:9661:22: warning: '_PyUnicode_get_wstr_length' is deprecated [-Wdeprecated-declarations]
                          (PyUnicode_GET_SIZE(**name) != PyUnicode_GET_SIZE(key)) ? 1 :
                           ^
      /Library/Frameworks/Python.framework/Versions/3.10/include/python3.10/cpython/unicodeobject.h:261:7: note: expanded from macro 'PyUnicode_GET_SIZE'
            PyUnicode_WSTR_LENGTH(op) :                    \
            ^
      /Library/Frameworks/Python.framework/Versions/3.10/include/python3.10/cpython/unicodeobject.h:451:35: note: expanded from macro 'PyUnicode_WSTR_LENGTH'
      #define PyUnicode_WSTR_LENGTH(op) _PyUnicode_get_wstr_length((PyObject*)op)
babaniyi commented 1 year ago

@mmp3 Use any python version <= 3.7