简体   繁体   中英

Unable to install sklearn 0.23.2 with pip 20.2.4 and python 3.9

I cant use higher version of pip other than 20.2.4, since some SSL certification errors are occuring in higher versions and cannot reinstall any settings I have now (because of some office setup). Now I am using Pycaret and currently it supports only sklearn 0.23.2.

But my sklearn version is 0.24.1 and I am unable to downgrade it with 20.2.4 version of pip.

I also tried manual installation using setup.py file and it is also not success.

I am having Winpython and unable to install anaconda too.

Can someone help me to sort this problem? I am having python 3.9. May be that is the problem?

Update:

Error message:
Collecting scikit-learn==0.23.2
  Using cached scikit-learn-0.23.2.tar.gz (7.2 MB)
  Installing build dependencies ... error
  ERROR: Command errored out with exit status 1:
   command: 'C:\Users\me\Desktop\WPy64-3902\Scripts\python.exe' 'C:\Users\me\Desktop\WPy64-3902\lib\site-packages\pip' install --ignore-installed --no-user --prefix 'C:\Users\me\AppData\Local\Temp\pip-build-env-w5t8h2zr\overlay' --no-warn-script-location --no-binary :none: --only-binary :none: -i https://pypi.org/simple -- setuptools wheel 'Cython>=0.28.5' 'numpy==1.13.3; python_version=='"'"'3.6'"'"' and platform_system!='"'"'AIX'"'"' and platform_python_implementation == '"'"'CPython'"'"'' 'numpy==1.14.0; python_version=='"'"'3.6'"'"' and platform_system!='"'"'AIX'"'"' and platform_python_implementation != '"'"'CPython'"'"'' 'numpy==1.14.5; python_version=='"'"'3.7'"'"' and platform_system!='"'"'AIX'"'"'' 'numpy==1.17.3; python_version>='"'"'3.8'"'"' and platform_system!='"'"'AIX'"'"'' 'numpy==1.16.0; python_version=='"'"'3.6'"'"' and platform_system=='"'"'AIX'"'"'' 'numpy==1.16.0; python_version=='"'"'3.7'"'"' and platform_system=='"'"'AIX'"'"'' 'numpy==1.17.3; python_version>='"'"'3.8'"'"' and platform_system=='"'"'AIX'"'"'' 'scipy>=0.19.1'
       cwd: None
  Complete output (547 lines):
  Ignoring numpy: markers 'python_version == "3.6" and platform_system != "AIX" and platform_python_implementation == "CPython"' don't match your environment
  Ignoring numpy: markers 'python_version == "3.6" and platform_system != "AIX" and platform_python_implementation != "CPython"' don't match your environment
  Ignoring numpy: markers 'python_version == "3.7" and platform_system != "AIX"' don't match your environment
  Ignoring numpy: markers 'python_version == "3.6" and platform_system == "AIX"' don't match your environment
  Ignoring numpy: markers 'python_version == "3.7" and platform_system == "AIX"' don't match your environment
  Ignoring numpy: markers 'python_version >= "3.8" and platform_system == "AIX"' don't match your environment

I tried various things, and the best advice I can give you is don't bother with python 3.9 for this library; It's just not supported yet. Dependencies are not sorted out yet for pycaret yet on python 3.9, and they should probably make note of that on their github, but here's the process I went through to get it installed from a completely fresh computer (windows sandbox).

  • Get miniconda to handle environments (or full fat anaconda if you want). Conda treats python itself as a package making it easy to create env's with different python versions. The version doesn't matter too much, as you'll be creating an env with python 3.8. I used `Miniconda3 Windows 64-bit`.
  • Get the Microsoft visual studio c++ build tools . It's possible you won't need them now that we're moving back to 3.8, but it's just good to have for installing any libraries which aren't distributed as pre-built binaries.
  • Create and activate your env:
     C:\Users\WDAGUtilityAccount>conda create --name py38 python=3.8 

    C:\Users\WDAGUtilityAccount>activate py38

  • Update setuptools then install pycaret
     (py38) C:\Users\WDAGUtilityAccount>pip install -U setuptools 

    (py38) C:\Users\WDAGUtilityAccount>pip install pycaret

  • Test installation:
     (py38) C:\Users\WDAGUtilityAccount>python Python 3.8.10 (default, May 19 2021, 13:12:57) [MSC v.1916 64 bit (AMD64)]:: Anaconda, Inc. on win32 Type "help", "copyright", "credits" or "license" for more information.  >>> import pycaret >>> #look ma;  no errors:)
  • The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

     
    粤ICP备18138465号  © 2020-2024 STACKOOM.COM