简体   繁体   English

无法使用 pip 20.2.4 和 python 3.9 安装 sklearn 0.23.2

[英]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).我不能使用除 20.2.4 之外的更高版本的 pip,因为在更高版本中会出现一些 SSL 认证错误,并且无法重新安装我现在拥有的任何设置(因为某些办公室设置)。 Now I am using Pycaret and currently it supports only sklearn 0.23.2.现在我正在使用 Pycaret,目前它只支持 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.但是我的 sklearn 版本是 0.24.1,我无法使用 20.2.4 版本的 pip 降级它。

I also tried manual installation using setup.py file and it is also not success.我还尝试使用 setup.py 文件进行手动安装,但也没有成功。

I am having Winpython and unable to install anaconda too.我有 Winpython,也无法安装 anaconda。

Can someone help me to sort this problem?有人可以帮我解决这个问题吗? I am having python 3.9.我有 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;我尝试了各种方法,我能给你的最好建议是不要为这个库使用 python 3.9; 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). python 3.9 上的 pycaret 依赖关系尚未解决,他们可能应该在 github 上记下这一点,但这是我从全新计算机(Windows 沙箱)安装它的过程。

  • Get miniconda to handle environments (or full fat anaconda if you want).获取miniconda来处理环境(或全脂 anaconda,如果需要)。 Conda treats python itself as a package making it easy to create env's with different python versions. Conda 将 python 本身视为 package 使得创建具有不同 python 版本的环境变得容易。 The version doesn't matter too much, as you'll be creating an env with python 3.8.版本无关紧要,因为您将使用 python 3.8 创建一个环境。 I used `Miniconda3 Windows 64-bit`.我使用了`Miniconda3 Windows 64-bit`。
  • Get the Microsoft visual studio c++ build tools . 获取 Microsoft Visual Studio c++ 构建工具 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.现在我们回到 3.8,您可能不需要它们,但安装任何未作为预构建二进制文件分发的库是件好事。
  • Create and activate your env:创建并激活您的环境:
     C:\Users\WDAGUtilityAccount>conda create --name py38 python=3.8 C:\Users\WDAGUtilityAccount>conda create --name py38 python=3.8

    C:\Users\WDAGUtilityAccount>activate py38 C:\Users\WDAGUtilityAccount>激活 py38

  • Update setuptools then install pycaret更新 setuptools 然后安装 pycaret
     (py38) C:\Users\WDAGUtilityAccount>pip install -U setuptools (py38) C:\Users\WDAGUtilityAccount>pip install -U setuptools

    (py38) C:\Users\WDAGUtilityAccount>pip install pycaret (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. (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 ”、“版权”、“学分”或“许可”以获取更多信息。 >>> import pycaret >>> #look ma; >>> 导入 pycaret >>> #look ma; no errors:)没有错误:)
  • 声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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