square / pysurvival

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

Still installation issue #72

Closed morinstar closed 6 months ago

morinstar commented 8 months ago

I watched every guide and I am using PY. I am using py3.7 venv due to campatibility issue, I installed the C++ complier and I installed scikit-learn instead of sklearn. Still got this error reported:

ERROR: Command errored out with exit status 1: command: 'D:\applications\py3.77\pythonw37.exe' -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\Users\lenovo\AppData\Local\Temp\pip-install-20jj10l0\sklearn\setup.py'"'"'; file='"'"'C:\Users\lenovo\AppData\Local\Temp\pip-install-20jj10l0\sklearn\setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(file);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, file, '"'"'exec'"'"'))' egg_info --egg-base pip-egg-info cwd: C:\Users\lenovo\AppData\Local\Temp\pip-install-20jj10l0\sklearn\ Complete output (15 lines): The 'sklearn' PyPI package is deprecated, use 'scikit-learn' rather than 'sklearn' for pip commands.

Here is how to fix this error in the main use cases:
- use 'pip install scikit-learn' rather than 'pip install sklearn'
- replace 'sklearn' by 'scikit-learn' in your pip requirements files
  (requirements.txt, setup.py, setup.cfg, Pipfile, etc ...)
- if the 'sklearn' package is used by one of your dependencies,
  it would be great if you take some time to track which package uses
  'sklearn' instead of 'scikit-learn' and report it to their issue tracker
- as a last resort, set the environment variable
  SKLEARN_ALLOW_DEPRECATED_SKLEARN_PACKAGE_INSTALL=True to avoid this error

More information is available at
https://github.com/scikit-learn/sklearn-pypi-package
----------------------------------------

ERROR: Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output. WARNING: You are using pip version 19.2.3, however version 23.3.2 is available. You should consider upgrading via the 'python -m pip install --upgrade pip' command.

Any idea how to solve this?

islaja commented 6 months ago

first: export SKLEARN_ALLOW_DEPRECATED_SKLEARN_PACKAGE_INSTALL=True then: pip install pysurvival

Arminkhayati commented 6 months ago

I fixed it using this approach:

morinstar commented 6 months ago

first: export SKLEARN_ALLOW_DEPRECATED_SKLEARN_PACKAGE_INSTALL=True then: pip install pysurvival

Thx buddy! I was in windows os and pysurvival clearly missed some part to be compatible here. After that environment varible setted, still got more coming up errors. I ended up downloading Bacalfa's zip and installed this package.

morinstar commented 6 months ago

I fixed it using this approach:

  • On Ubuntu or Windows WSL2 Ubuntu run this command: sudo apt install build-essential
  • Then install Anaconda and create a Python 3.7 environment.
  • Clone this repository, edit requirements.txt file and remove sklearn line.
  • Go to the directory you cloned using cd command and run pip install -e .

Thx a lot! I am on Windows OS and switching to Ubuntu or Linux sounds like a lot trouble. I got some hint from your tips tho. Did it with the package modified by Bacalfa https://github.com/square/pysurvival/issues/8

morinstar commented 6 months ago

problem solved

taoziyu97 commented 5 months ago

I fixed it using this approach:

  • On Ubuntu or Windows WSL2 Ubuntu run this command: sudo apt install build-essential
  • Then install Anaconda and create a Python 3.7 environment.
  • Clone this repository, edit requirements.txt file and remove sklearn line.
  • Go to the directory you cloned using cd command and run pip install -e .

Thank you! Solved!