square / pysurvival

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

Install successful but can not import some modules #19

Open cecil185 opened 4 years ago

cecil185 commented 4 years ago

I successfully installed pysurvival (after doing brew install gcc and export CC and CXX as per instructions), but when I try to import pysurvival into jupyter notebook I get this error.

Screen Shot 2019-12-29 at 9 47 44 PM

And when I try to import some pysurvival modules there is no problem.

Screen Shot 2019-12-29 at 9 48 43 PM

Is there maybe some conflict between GCC and clang when compiling C++ code? My OS is Mac OSX Catalina 10.15.1 and I am using Python 3.7.4 but Python 2.7 also exist on my computer.

lotusflyer commented 4 years ago

Based on https://github.com/facebookresearch/fastText/issues/380 I downgraded to Python 3.5 and it started working.

Python 3.5.5 | packaged by conda-forge | (default, Jul 23 2018, 23:45:11) [GCC 4.2.1 Compatible Apple LLVM 6.1.0 (clang-602.0.53)] on darwin

luisdiegocm commented 4 years ago

What I did was run this code in Terminal before running Jupyter Notebook.

I have the latest gcc version from brew, and Python 3.7.

export CC=/usr/local/Cellar/gcc/9.2.0_3/bin/gcc-9 export CXX=/usr/local/Cellar/gcc/9.2.0_3/bin/g++-9 export DYLD_LIBRARY_PATH=/usr/local/Cellar/gcc/9.2.0_3/lib/gcc/9/:$DYLD_LIBRARY_PATH export LD_LIBRARY_PATH=/usr/local/Cellar/gcc/9.2.0_3/lib/gcc/9/:$LD_LIBRARY_PATH

anubhav0723 commented 4 years ago

I tried the above command it is not working

TrueKoala commented 4 years ago

What I did was run this code in Terminal before running Jupyter Notebook.

I have the latest gcc version from brew, and Python 3.7.

export CC=/usr/local/Cellar/gcc/9.2.0_3/bin/gcc-9 export CXX=/usr/local/Cellar/gcc/9.2.0_3/bin/g++-9 export DYLD_LIBRARY_PATH=/usr/local/Cellar/gcc/9.2.0_3/lib/gcc/9/:$DYLD_LIBRARY_PATH export LD_LIBRARY_PATH=/usr/local/Cellar/gcc/9.2.0_3/lib/gcc/9/:$LD_LIBRARY_PATH`

This is the way to fix this issue as luisdiegogocm suggested. You just need to make sure you change it to the correct gcc - the latest version is 9.3.0

KaranMehta21 commented 4 years ago

Hi @TrueKoala and @luisdiegocm. I've updated gcc and ran your code before opening Jupyter notebook. My version of gcc is 9.3.0_1 Then, I ran 'import pysurvival' in the notebook but cannot import some of the psyurvival models such as random survival forest and deep surv

danilobso commented 4 years ago

Hello, I'am facing the same issue, and the 2 commands above did not work for me, while changing the gcc version for the on I have installed.

anubhav0723 commented 3 years ago

Do we have any update on this? I am also facing the same issue. And the solution mentioned above is not working. Any help will be highly appreciated.