简体   繁体   English

我无法在python3上导入scikit -learn。 如何导入?

[英]I can`t import scikit -learn on python3. how can i import it?

I installed numpy-1.13.1+mkl-cp36-cp36m-win32 .whl and scipy-0.19.1-cp36-cp36m-win32.whl successfully, then I installed scikit-learn successfully, but when I ran import sklearn, pycharm gave me errors. 我成功安装了numpy-1.13.1 + mkl-cp36-cp36m-win32 .whl和scipy-0.19.1-cp36-cp36m-win32.whl,然后我成功安装了scikit-learn,但是当我运行导入sklearn时,pycharm给出了我的错误。 How can I remove this problem? 如何解决此问题? I installed python3.6 (32bit) on windows 10 (64bit). 我在Windows 10(64bit)上安装了python3.6(32bit)。

import sklearn

result of run: 运行结果:

C:\Users\Emertat\AppData\Local\Programs\Python\Python36-32\python.exe "F:/Python/NS videos/cedes/Exercise 07 test.py"
Traceback (most recent call last):
  File "F:/Python/NS videos/cedes/Exercise 07 test.py", line 21, in <module>
    import sklearn
  File "C:\Users\Emertat\AppData\Local\Programs\Python\Python36-32\lib\site-packages\sklearn\__init__.py", line 134, in <module>
    from .base import clone
  File "C:\Users\Emertat\AppData\Local\Programs\Python\Python36-32\lib\site-packages\sklearn\base.py", line 12, in <module>
    from .utils.fixes import signature
  File "C:\Users\Emertat\AppData\Local\Programs\Python\Python36-32\lib\site-packages\sklearn\utils\__init__.py", line 11, in <module>
    from .validation import (as_float_array,
  File "C:\Users\Emertat\AppData\Local\Programs\Python\Python36-32\lib\site-packages\sklearn\utils\validation.py", line 18, in <module>
    from ..utils.fixes import signature
  File "C:\Users\Emertat\AppData\Local\Programs\Python\Python36-32\lib\site-packages\sklearn\utils\fixes.py", line 144, in <module>
    from scipy.sparse.linalg import lsqr as sparse_lsqr  # noqa
  File "C:\Users\Emertat\AppData\Local\Programs\Python\Python36-32\lib\site-packages\scipy\sparse\linalg\__init__.py", line 117, in <module>
    from .matfuncs import *
  File "C:\Users\Emertat\AppData\Local\Programs\Python\Python36-32\lib\site-packages\scipy\sparse\linalg\matfuncs.py", line 19, in <module>
    import scipy.special
  File "C:\Users\Emertat\AppData\Local\Programs\Python\Python36-32\lib\site-packages\scipy\special\__init__.py", line 640, in <module>
    from ._ufuncs import *
ImportError: DLL load failed: The specified procedure could not be found.

Process finished with exit code 1

First, Remove the sklearn form your Windows OS by using the following command- 首先,使用以下命令从Windows操作系统中删除sklearn-

pip uninstall scikit-learn

Then, you need to install numpy and scipy from their own official installers. 然后,您需要从他们自己的官方安装程序中安装 numpyscipy

Wheel packages (.whl files) for scikit-learn from pypi can be installed with the pip utility. 可以使用pip实用程序安装来自pypi的 scikit-learn的Wheel包(.whl文件)。 Open a console and type the following to install or upgrade scikit-learn to the latest stable release: 打开控制台并键入以下内容以将scikit-learn安装或升级到最新的稳定版本:

pip install -U scikit-learn

If there are no binary packages matching your python, version you might to try to install scikit-learn and its dependencies from christoph gohlke unofficial windows installers or from a python distribution instead. 如果没有与您的python版本匹配的二进制软件包,则可以尝试从christoph gohlke非官方Windows安装程序或从python发行版安装scikit-learn及其依赖项。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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