pysurvival icon indicating copy to clipboard operation
pysurvival copied to clipboard

Install successful but can not import some modules

Open cecil185 opened this issue 5 years ago • 7 comments

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.

cecil185 avatar Dec 30 '19 04:12 cecil185

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

lotusflyer avatar Jan 02 '20 22:01 lotusflyer

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

luisdiegocm avatar Jan 12 '20 19:01 luisdiegocm

I tried the above command it is not working

anubhav0723 avatar Jan 29 '20 18:01 anubhav0723

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

TrueKoala avatar Apr 02 '20 14:04 TrueKoala

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

KaranMehta21 avatar Apr 18 '20 16:04 KaranMehta21

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.

danilobso avatar Apr 26 '20 21:04 danilobso

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.

anubhav0723 avatar Oct 07 '20 15:10 anubhav0723