今天在安装 Python 的 sklearn 包时出现了 Cannot uninstall 'numpy' 和 Cannot uninstall 'scipy' 错误,下面记录了我尝试了很多网上的方法后最终成功的解决方法。

终端执行 pip install scikit-learn 后,出现 Cannot uninstall 'numpy'. It is a distutils installed project and thus we cannot accurately determine which files belong to it which would lead to only a partial uninstall.

执行 sudo pip install --upgrade --ignore-installed --install-option '--install-data=/usr/local' numpy 后成功更新 numpy,再次执行 pip install scikit-learn ,出现

Cannot uninstall 'scipy'. It is a distutils installed project and thus we cannot accurately determine which files belong to it which would lead to only a partial uninstall.

执行 sudo pip install --upgrade scipy --ignore-installed six ,成功更新 scipy

再次执行 pip install scikit-learn 后出现权限问题,运行 sudo pip install scikit-learn ,成功安装 sklearn包(见下图)。

另外,我在 Python 3 下安装 scikit-learn 没有出现该类错误,可能是因为 numpy 和 scipy 的版本够高。若是要在 python 3 下安装,前面的指令中 pip 用 pip3 替代。

Python: 安装 sklearn 包出现错误的解决方法的更多相关文章

  1. 在安装mysql出现的错误以及解决方法

    因为手贱更新了一下驱动,结果导致无线网卡出了问题.然而就算是从官网上下载了驱动各种折腾也没有弄好,心里特别堵.无奈只有重装系统这一条路了.这里表示特别难过,因为电脑上东西实在太多了,而且各种环境变量. ...

  2. python安装途中遇到的问题和解决方法

    一.setuptools安装错误:RuntimeError: Compression requires the (missing) zlib module 1. 描述 搞了个腾讯云的服务器,闲在手上没 ...

  3. ubuntu16.04下安装openssh-server报依赖错误的解决方法

    问题:系统重装后,安装和配置SSH,防火墙配置 #安装install openssh-server sudo apt install openssh-server -y 遇到问题: sudo apt ...

  4. 树莓派安装 MySQL 时出现错误的解决方法

    今天被要求解决一个树莓派无法正常安装 MySQL 的问题.以下是解决过程记录. 我在 Mac 上利用 SSH 连接到树莓派,执行 sudo apt-get install mysql-server m ...

  5. Python使用request包请求网页乱码解决方法

    使用requests请求网页时,返回的页面信息有时是乱码,如下代码 headers = { 'User-Agent': 'Mozilla/5.0 (Windows NT 6.1; WOW64) App ...

  6. python tcp黏包和struct模块解决方法,大文件传输方法及MD5校验

    一.TCP协议 粘包现象 和解决方案 黏包现象让我们基于tcp先制作一个远程执行命令的程序(命令ls -l ; lllllll ; pwd)执行远程命令的模块 需要用到模块subprocess sub ...

  7. 安装MySql-Python遇到的错误及解决方法

    用pip安装mysql-python时报错: _mysql.c _mysql.c(42) : fatal error C1083: Cannot open include file: 'config- ...

  8. 【UE4游戏开发】安装UE4时报SU-PQR1603错误的解决方法

    马三在开发过程中一直用的都是UE4.9版本(很久没有更新了.),因为功能都够用,所以也懒得去更新.这不最近UE4 发布了最新的4.14版本,本来想尝个鲜,试试新版的UE引擎怎么样,结果这一安装上就一直 ...

  9. Windows 上安装 Redis 及可能出现的错误和解决方法!

    前言 Redis(REmote Dictionary Server) 是一种以key-value写得存储系统.他是开源的ANSI语言编写的.遵守BSD协议.被称作“数据结构服务器”,因为它的值(val ...

随机推荐

  1. samba Nginx

    1.samba 2.nfs 3.crond 4.nginx ifconfig yum install net-tools -y ifconfig #查看所有已激活的网卡信息 ifconfig eth0 ...

  2. VxVM vxsnap ERROR V-5-1-0 Volume cannot be linked due to size/regionsize incompatibility

    在做vxsnap addmir时报错如下: #> vxsnap -g OLS_DATA_DG -b addmir OLS_DATA_ACC_P mirvol=OLS_DATA_ACC_SM1 V ...

  3. elasticsearch(3) curl命令

    curl 操作http的get/post/put/delete CURL 命令参数-a/--append 上传文件时,附加到目标文件-A/--user-agent <string> 设置用 ...

  4. linux命令-passwd

    修改密码 #passwd 新密码 重新输入密码 #passwd dennywang  ////命令+用户名 ////////////////////////////////////////////// ...

  5. 什么是个CDN???CDN是干什么的??

    1.什么是CDN??? CDN的全称是Content Delivery Network,即内容分发网络.其目的是通过在现有的Internet中增加一层新的网络架构,将网站的内容发布到最接近用户的网络& ...

  6. oracle -sqlplus 调用存储过程

    sp.batsqlplus user/passwd/sid  @.\sp.sql >sp.sqlexit; sp.sqlexex xxxx()quit;

  7. MyBatis总结一:快速入门

    简介 MyBatis 是一款优秀的持久层框架,它支持定制化 SQL.存储过程以及高级映射.MyBatis 避免了几乎所有的 JDBC 代码和手动设置参数以及获取结果集.MyBatis 可以使用简单的 ...

  8. KNN算法实现

    import csvimport randomimport mathimport operatorimport numpy as np def loadDataset(filename,split,t ...

  9. Struts2框架07 Struts2 + Spring + Mybatis 整合

    1 导包 <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.o ...

  10. linux ftp、sftp、telnet服务开通、更改Orale最大连接数

    1 ftp服务开通 1.1 检测vsftpd是否安装及启动 先用service vsftpd status 来查看ftp是否开启.也可以使用ps -ef | grep ftp 来查看本地是否含有包含f ...