pysurvival icon indicating copy to clipboard operation
pysurvival copied to clipboard

Windows Installation

Open bacalfa opened this issue 5 years ago • 47 comments

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.

bacalfa avatar Aug 18 '19 03:08 bacalfa

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

CedricBeaulac avatar Sep 11 '19 17:09 CedricBeaulac

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

bharatbk avatar Sep 19 '19 12:09 bharatbk

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

CoteDave avatar Oct 17 '19 17:10 CoteDave

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!

bacalfa avatar Oct 18 '19 20:10 bacalfa

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/

bharatbk avatar Oct 18 '19 23:10 bharatbk

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.

bacalfa avatar Oct 18 '19 23:10 bacalfa

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

nd26 avatar Oct 30 '19 18:10 nd26

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 avatar Nov 23 '19 10:11 DrShyamalaDevi

image I am getting the above error while installing pysurvival

DrShyamalaDevi avatar Nov 23 '19 10:11 DrShyamalaDevi

@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

bacalfa avatar Nov 23 '19 16:11 bacalfa

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

DrShyamalaDevi avatar Nov 24 '19 12:11 DrShyamalaDevi

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.

bacalfa avatar Nov 24 '19 16:11 bacalfa

@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

camferna avatar Jan 27 '20 11:01 camferna

@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).

bacalfa avatar Jan 27 '20 12:01 bacalfa

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. :(

camferna avatar Jan 27 '20 13:01 camferna

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.

bacalfa avatar Jan 27 '20 13:01 bacalfa

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.

camferna avatar Jan 27 '20 13:01 camferna

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.

bacalfa avatar Jan 27 '20 13:01 bacalfa

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?

camferna avatar Jan 27 '20 15:01 camferna

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 avatar Jan 27 '20 15:01 bacalfa

@CamilaFernandez8, please see my latest post here.

bacalfa avatar Jan 29 '20 04:01 bacalfa

@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.

bacalfa avatar Mar 26 '20 21:03 bacalfa

@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.

canshop16 avatar Mar 27 '20 04:03 canshop16

@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?

KaranMehta21 avatar Apr 28 '20 11:04 KaranMehta21

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

bacalfa avatar Apr 28 '20 21:04 bacalfa

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

KaranMehta21 avatar Apr 28 '20 22:04 KaranMehta21

@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 !

SelverEzgi avatar May 13 '20 08:05 SelverEzgi

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)

SurajitTest avatar May 17 '20 08:05 SurajitTest

@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.

bacalfa avatar May 17 '20 14:05 bacalfa

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)

SurajitTest avatar May 19 '20 04:05 SurajitTest