pysurvival
pysurvival copied to clipboard
Windows Installation
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.
I find myself in the same predicament. Is the library even suppose to work for Windows ?
Same issue with Anaconda install. Perhaps one could fork the implementation to use Numpy primitives instead for doing calculations?
Hi, is there any hope to see a working version for windows ? Looks like the best package available for survival analysis ! Thanks!
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!
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/
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.
Hey @bacalfa, I've successfully managed to install pysurvival (on Windows) from your repository. Thank you!
bacalfa, I could not install pysurvival.
I have installed pytorch and the basic requirements. But still it is saying error
Can u help me out.
I have downloaded the GCC compiler too
I am getting the above error while installing pysurvival
@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.
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
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 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
@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).
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. :(
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.
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.
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.
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?
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
@CamilaFernandez8, please see my latest post here.
@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 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.
@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, I don't believe this is related to pysurvival
. It may be due to your Python installation. Have you searched for this issue?
@bacalfa Not to worry - I was able to solve the problem and train the RSF model. Thanks!
@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 !
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, 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.
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)