Scikit-learn机器学习库的安装

xiaoxiao2021-02-28  49

scikit-learn是Python的一个开源机器学习模块,它建立在NumPy、matplotlib和SciPy模块之上能够为用户提供各种机器学习算法接口,可以让用户简单、高效地进行数据挖掘和数据分析。 系统:windows7 64位操作系统 Python版本:Python 2.7.12 模块下载地址:www.lfd.uci.edu/~gohlke/pythonlibs/

                         numpy-1.11.3+mkl-cp27-cp27m-win_amd64.whl

                         scipy-0.19.1-cp27-cp27m-win_amd64.whl 经检验:64位的不匹配 查看:显示当前版本信息 >>>import pip >>> print(pip.pep425tags.get_supported())    ===>>(cp27,cp27m,win32) 故选择安装:numpy-1.13.1+mkl-cp27-cp27m-win32.whl、matplotlib-1.5.3-cp27-cp27m-win32.whl、                      scipy-0.19.1-cp27-cp27m-win32.whl和scikit_learn-0.19.0-cp27-cp27m-win32.whl  一、安装顺序及过程:

1、安装wheel

===D:\软件\python\setup\Scripts>>pip install wheel 2、安装numpy-1.13.1+mkl-cp27-cp27m-win32.whl ===D:\软件\python\setup\Scripts>>pip install D:\软件\Sklearn\new\numpy-1.13.1+mkl-cp27-cp27m-win32.whl 3、安装matplotlib-1.5.3-cp27-cp27m-win32.whl ===D:\软件\python\setup\Scripts>>pip install D:\软件\Sklearn\new\matplotlib-1.5.3-cp27-cp27m-win32.whl 4、安装scipy-0.19.1-cp27-cp27m-win32.whl ===D:\软件\python\setup\Scripts>>pip install D:\软件\Sklearn\new\scipy-0.19.1-cp27-cp27m-win32.whl 5、安装scikit_learn-0.19.0-cp27-cp27m-win32.whl ===D:\软件\python\setup\Scripts>>pip install scikit_learn-0.19.0-cp27-cp27m-win32.whl 出现问题:raise ReadTimeoutError(self._pool, None, 'Read timed out.') ReadTimeoutError: HTTPSConnectionPool 解决方法:设置超时时间 ===D:\软件\python\setup\Scripts>>pip --default-timeout=100 install -U sklearn 二、安装过程遇到的一些问题: 1、File "C:\Python27\lib\ntpath.py", line 85, in join     result_path = result_path + p_path UnicodeDecodeError: 'ascii' codec can't decode byte 0xc0 in position 0: ordinal not in range(128) 解决办法:D:\软件\python\setup\Lib\ntpath.py              85行改为:               sysencoding = sys.getfilesystemencoding()           try:               result_path = result_path + p_path           except UnicodeDecodeError :               result_path = result_path.decode(sysencoding).encode(sysencoding)+p_path.decode(sysencoding).encode(sysencoding) 2、File "d:\软件\python\setup\lib\site-packages\pip-9.0.1-py2.7.egg\pip\wheel.py" ,line 184, in fix_script exename = sys.executable.encode(sys.getfilesystemencoding())

UnicodeDecodeError: 'utf8' codec can't decode byte 0xc8 in position 3: invalid continuation byte

解决办法:         try:             exename = sys.executable.encode(sys.getfilesystemencoding())         except UnicodeDecodeError :             exename = sys.executable.decode(sys.getfilesystemencoding()).encode(sys.getfilesystemencoding())
转载请注明原文地址: https://www.6miu.com/read-250109.html

最新回复(0)