square / pysurvival

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

Windows Installation #8

Open bacalfa opened 5 years ago

bacalfa commented 5 years ago

Doesn't seem to work with pip install pysurvival.

...
pysurvival/cpp_extensions/non_parametric.cpp(349): error C2065: 'M_PI': undeclared identifier
pysurvival/cpp_extensions/non_parametric.cpp(364): error C2065: 'M_PI': undeclared identifier
  error: command 'C:\\Program Files (x86)\\Microsoft Visual Studio 14.0\\VC\\BIN\\x86_amd64\\cl.exe' failed with exit status 2

See https://stackoverflow.com/questions/6563810/m-pi-works-with-math-h-but-not-with-cmath-in-visual-studio.

CedricBeaulac commented 5 years ago

I find myself in the same predicament. Is the library even suppose to work for Windows ?

bharatbk commented 4 years ago

Same issue with Anaconda install. Perhaps one could fork the implementation to use Numpy primitives instead for doing calculations?

CoteDave commented 4 years ago

Hi, is there any hope to see a working version for windows ? Looks like the best package available for survival analysis ! Thanks!

bacalfa commented 4 years ago

It seems there's not much of a support going on with this project, which is unfortunate! :( I took the liberty of addressing this issue and pushed the changes to my forked project: https://github.com/bacalfa/pysurvival (I don't have permission to push changes to this repo). I was able to build and install it on Windows 10 (MSVC14), RHEL (gcc-8.2.0), and Mac (clang-1100.0.33.8).

Comments and feedback are welcome!

bharatbk commented 4 years ago

It seems there's not much of a support going on with this project, which is unfortunate! :( I took the liberty of addressing this issue and pushed the changes to my forked project: https://github.com/bacalfa/pysurvival (I don't have permission to push changes to this repo). I was able to build and install it on Windows 10 (MSVC14), RHEL (gcc-8.2.0), and Mac (clang-1100.0.33.8).

* Building the package
  `python setup.py build_ext --inplace`

* Installing the package
  `python setup.py install --user`

Comments and feedback are welcome!

Just tried it, looks like it required MSVC14 to install following those commands. Thanks for the try!

pysurvival-master>python setup.py build_ext --inplace
running build_ext
building 'pysurvival.utils._functions' extension
error: Microsoft Visual C++ 14.0 is required. Get it with "Microsoft Visual C++ Build Tools": https://visualstudio.microsoft.com/downloads/
bacalfa commented 4 years ago

Weird... do you have any compiler installed at all? You'll need it for the C++ extensions. If you only need the Python functionality, you just have to run the "install" command.

We all had problems installing via pip because it tried to compiled the C++ extensions. But if all you need is the Python package, you don't need to compile any code in this project.

nd26 commented 4 years ago

Hey @bacalfa, I've successfully managed to install pysurvival (on Windows) from your repository. Thank you!

DrShyamalaDevi commented 4 years ago

bacalfa, I could not install pysurvival. I have installed pytorch and the basic requirements. But still it is saying error image Capture Can u help me out.

I have downloaded the GCC compiler too

DrShyamalaDevi commented 4 years ago

image I am getting the above error while installing pysurvival

bacalfa commented 4 years ago

@DrShyamalaDevi Did you download or clone my modified project from https://github.com/bacalfa/pysurvival? Please try to install that project, and not the one in this original repository. The error you got was fixed with my modifications.

image

DrShyamalaDevi commented 4 years ago

i am not cloning or downloading ur project from ur github. i am trying to install the package pysurvival. will it work for windows os. i am trying to install in windows. and i am getting the above error

bacalfa commented 4 years ago

That's what we're discussing in this issue. The original project doesn't work on Windows. I don't have permission to submit my bug fixes. So I cloned the project on my page and fixed the problems there. You won't be able to install pysurvival on Windows from this repository until the maintainer fix the problems like I did on my repository.

camferna commented 4 years ago

@bacalfa I installed the library from your github :D But I want to modify something, do you (or someone) know if there is any problem if I do that? Like should I have to reinstall the library or it should just work with the thing I added? Thank you in advance!!

Cam

bacalfa commented 4 years ago

@CamilaFernandez8 Great! Is your modification general enough so that everyone else might use? If so, I could add you a collaborator so you can push your changes and I can review them. Otherwise, you can always make changes to your local copy and never publish them (this will keep your copy out-of-sync with my repository).

camferna commented 4 years ago

oooh no I'm a really bad/begginer programmer. Just trying to make some functions work with scikit learn and I'm afraid that if I modify the codes it will stop working and will have to reinstall it again. :(

bacalfa commented 4 years ago

What functions? And what kind of interoperability with sklearn are you looking for? Is it related to this issue? Again, you can always make changes to your local copy. That won't affect anyone else.

camferna commented 4 years ago

Yes, that issue :( No one answered it :( I know it won't affect anyone else, I want to know if it will affect my own current library operation.

bacalfa commented 4 years ago

I haven't looked into that issue in detail. You can give it a try and see what happens. :) If I have some time, I'll see what I can do to address that, and then let you know.

camferna commented 4 years ago

But then, If I modify it and I want to run my program with the modifications. Do I need to install the whole library again or update it or something? or it is instantly ready to use it?

bacalfa commented 4 years ago

If you're only modifying Python code, you just have to run the following to copy your modifications to the right directories:

python setup.py install --user

bacalfa commented 4 years ago

@CamilaFernandez8, please see my latest post here.

bacalfa commented 4 years ago

@canshop16 I don't think that error is related to pysurvival. Installation instructions are given above: https://github.com/square/pysurvival/issues/8#issuecomment-543916159. If you install it to a specific environment, make sure you're starting Jupyter Notebook from that environment.

canshop16 commented 4 years ago

@bacalfa Thank you so much for your contribution. I ran this on Anaconda prompt after downloading your setup.py file from your GitHub and it worked on Windows.

*Building the package python setup.py build_ext --inplace

*Installing the package python setup.py install --user

Thank you again.

KaranMehta21 commented 4 years ago

@bacalfa When running your code in line #8, I get the following error:

(base) C:\Users\rmhikme\Desktop\pysurvival-master>python setup.py install --user running install error: can't create or remove files in install directory The following error occurred while trying to add or remove files in the installation directory: [Errno 2] No such file or directory: 'C:\Users\rmhikme\AppData\Roaming\Python\Python37\site-packages\test-easy-install-11600.write-test' The installation directory you specified (via --install-dir, --prefix, or the distutils default setting) was: C:\Users\rmhikme\AppData\Roaming\Python\Python37\site-packages\ This directory does not currently exist. Please create it and try again, or choose a different installation directory (using the -d or --install-dir option).

How should I fix this and install your version of pysurvival?

bacalfa commented 4 years ago

@KaranMehta21, I don't believe this is related to pysurvival. It may be due to your Python installation. Have you searched for this issue?

KaranMehta21 commented 4 years ago

@bacalfa Not to worry - I was able to solve the problem and train the RSF model. Thanks!

SelverEzgi commented 4 years ago

@bacalfa thanx for fixing the windows issue. Now, i've installed the pysurvival on the windows using anaconda prompt. Just you need the install C++ compiler (i installed VisualStudio Desktop Development C++) and run

python setup.py build_ext --inplace line in anaconda prompt. Before the install the package, (if you dont have, you can install pytorch, from anaconda environemnts) and after, run python setup.py install --user command. Great work !

SurajitTest commented 4 years ago

Hi All, Would really appreciate if anyone can help me. I have downloaded the package which is at location : C:\Users\User\Downloads\pysurvival-master. For me , I have installed Anaconda at C:\Users\User. I am providing you with the steps that I think I need to follow, please guide so that I can carry out the installation correctly.

Step-1: Create a Directory : C:\Users\User\pysurvival (as Anaconda is installed in C:\Users\User ) Step-2: Copy all contents from C:\Users\User\Downloads\pysurvival-master to C:\Users\User\pysurvival (now setup.py is in this location) Step-3: Navigate to C:\Users\User\pysurvival (using command prompt) Step-4: Run the 2 below commands python setup.py build_ext --inplace (to rebuild the package) python setup.py install --user (to install the files to your local directories)

bacalfa commented 4 years ago

@SurajitTest, and what's the error you get? You don't have to place the files in a specific location for the installation to work. Any directory is fine.

SurajitTest commented 4 years ago

Hi @bacalfa, Thanks for your reply. Just wanted to know if my process of installation looks ok as I donot want to mess up my installation ?

I have downloaded the package which is at location : C:\Users\User\Downloads\pysurvival-master. For me , I have installed Anaconda at C:\Users\User. I am providing you with the steps that I think I need to follow, please guide so that I can carry out the installation correctly.

Step-1: Create a Directory : C:\Users\User\pysurvival (as Anaconda is installed in C:\Users\User ) Step-2: Copy all contents from C:\Users\User\Downloads\pysurvival-master to C:\Users\User\pysurvival (now setup.py is in this location) Step-3: Navigate to C:\Users\User\pysurvival (using command prompt) Step-4: Run the 2 below commands python setup.py build_ext --inplace (to rebuild the package) python setup.py install --user (to install the files to your local directories)

bacalfa commented 4 years ago

Looks OK to me.

fxpaquette commented 3 years ago

@bacalfa Thanks for your work, I was able to install pysurvival on Windows 10.

jacobgqc commented 3 years ago

In case anyone else has issues installing from @bacalfa's fork (thanks for updating this dead project :), ensure that you're using Python 3.8 or lower. Using 3.9 will result in an error due to the deprecation of tp_print https://stackoverflow.com/questions/65462530/pyclipper-installation-error-tp-print-is-not-a-member-of-typeobject

XiangBu commented 2 years ago

For those who suffered a lot to install pysurvival as as me python 3.7, good luck

git clone https://github.com/bacalfa/pysurvival cd pysurvival pip install .

nezha205 commented 2 years ago

anyone has this error ? thanks. image

fxpaquette commented 2 years ago

@nezha205 Refer to jacobgqc's anwser above. You get this error because you're using Python3.10

nezha205 commented 2 years ago

Bonjour, Merci pour ta réponse. Mais moi j'utilise la version du python 3.9.7

Le ven. 20 mai 2022 à 16:03, fxpaquette @.***> a écrit :

@nezha205 https://github.com/nezha205 Refer to jacobgqc's anwser above. You get this error because you're using Python3.10

— Reply to this email directly, view it on GitHub https://github.com/square/pysurvival/issues/8#issuecomment-1132937824, or unsubscribe https://github.com/notifications/unsubscribe-auth/ARPPZHAXDXNLO72LS7GV7OLVK6LTDANCNFSM4IMRHOMQ . You are receiving this because you were mentioned.Message ID: @.***>

fxpaquette commented 2 years ago

Bonjour, à ma compréhension toutes les versions supérieures à 3.8 produisent cette erreur.

Le ven. 20 mai 2022, 10 h 41, nezha205 @.***> a écrit :

Bonjour, Merci pour ta réponse. Mais moi j'utilise la version du python 3.9.7

Le ven. 20 mai 2022 à 16:03, fxpaquette @.***> a écrit :

@nezha205 https://github.com/nezha205 Refer to jacobgqc's anwser above. You get this error because you're using Python3.10

— Reply to this email directly, view it on GitHub https://github.com/square/pysurvival/issues/8#issuecomment-1132937824, or unsubscribe < https://github.com/notifications/unsubscribe-auth/ARPPZHAXDXNLO72LS7GV7OLVK6LTDANCNFSM4IMRHOMQ

. You are receiving this because you were mentioned.Message ID: @.***>

— Reply to this email directly, view it on GitHub https://github.com/square/pysurvival/issues/8#issuecomment-1132983968, or unsubscribe https://github.com/notifications/unsubscribe-auth/AMUQL3FVG6AL3PDSVQZIVTLVK6QBLANCNFSM4IMRHOMQ . You are receiving this because you commented.Message ID: @.***>

shanshui789 commented 2 years ago

@bacalfa bacalfa, I could not install pysurvival. 123 Can you help me out? Thank you!

vastolaa commented 2 years ago

Hi @bacalfa

Thank you for your repository, I've successfully managed to install pysurvival. However, it still gives me an error when trying to import pysurvival.utils._functions Any ideas how to solve this?

dsatija6 commented 1 year ago

Doesn't seem to work with pip install pysurvival.

...
pysurvival/cpp_extensions/non_parametric.cpp(349): error C2065: 'M_PI': undeclared identifier
pysurvival/cpp_extensions/non_parametric.cpp(364): error C2065: 'M_PI': undeclared identifier
  error: command 'C:\\Program Files (x86)\\Microsoft Visual Studio 14.0\\VC\\BIN\\x86_amd64\\cl.exe' failed with exit status 2

See https://stackoverflow.com/questions/6563810/m-pi-works-with-math-h-but-not-with-cmath-in-visual-studio.

Hey @bacalfa, all I want to do is use pysurvival in python to make a randomsurvivalforest model and use it. No C++ etc. Is that possible? If yes what should I use? Every time I use python setup.py install or something similar it gives me "building 'pysurvival.utils._functions' extension error: Microsoft Visual C++ 14.0 or greater is required. Get it with "Microsoft C++ Build Tools": https://visualstudio.microsoft.com/visual-cpp-build-tools/

Is there a way around this? Thank you in advance!

naeemomer commented 1 year ago

I am facing issues to install pysurvival and not able to follow the process here.

Can someone please post the installation of the package, for windows 10, in steps?

Thanks

jacobgqc commented 1 year ago

I am facing issues to install pysurvival and not able to follow the process here.

Can someone please post the installation of the package, for windows 10, in steps?

Thanks

Make sure you're using Python 3.8 or earlier. Other releases won't work.

Then instructions from XiangBu earlier:

git clone https://github.com/bacalfa/pysurvival
cd pysurvival
pip install .
morinstar commented 6 months ago

Your package worked on my Win11, that was a pain in the Rs but we got your help, thx for your efforts! for any one on Windows, here is what I did:

  1. install C++ Microsoft visual studio, I installed the lastest version, community 2022
  2. open cmd, put"set SKLEARN_ALLOW_DEPRECATED_SKLEARN_PACKAGE_INSTALL=True" and press enter to ignore the deprecated sklearn package error( supposed to not affect much in pysurvival package)
  3. download Bacalfa's repository
  4. cd to the directory where you put the repository
  5. put the two commends Bacalfa gave us above
  6. installed I also did a lot of changes during several other attempts but I guess they don't really help or matter, let me know if you are also on Windows and encounter with any other errors
KaranMehta21 commented 6 months ago

Hi @bacalfa is there a way to plot calibration curves using the deepsurv model? A calibration plot showing predicted risk versus observed risk. Please advise

bacalfa commented 6 months ago

To anyone seeking my support, I haven't used this package since my initial post in 2019. I'm not maintaining it either. Sorry.

KaranMehta21 commented 6 months ago

HI Bruno, can you help me with plotting calibration plots using the deepsurv model? I'm trying to plot predicted risk from the model versus observed risk.

Thanks

On Tue, Mar 5, 2024 at 6:45 PM Bruno Abreu Calfa @.***> wrote:

To anyone seeking my support, I haven't used this package since my initial post in 2019. I'm not maintaining it either. Sorry.

— Reply to this email directly, view it on GitHub https://github.com/square/pysurvival/issues/8#issuecomment-1979421513, or unsubscribe https://github.com/notifications/unsubscribe-auth/AMGKWX34GHW3KB6ZTTPDRJTYWYHCZAVCNFSM4IMRHOM2U5DIOJSWCZC7NNSXTN2JONZXKZKDN5WW2ZLOOQ5TCOJXHE2DEMJVGEZQ . You are receiving this because you were mentioned.Message ID: @.***>