报错:

DEPRECATION: Uninstalling a distutils installed project (six) has been deprecated and will be removed in a future version.
This is due to the fact that uninstalling a distutils project will only partially uninstall the project.
Uninstalling six-1.4.1:
Exception:
Traceback (most recent call last):
原因分析:

:Scrapy依赖six库,但是系统的six库比较老,安装scrapy需要卸载之后安装一个新的。但是Mac OS本身也依赖six,导致无法删除,因此没有办法安装Scrapy。

 解决的方式:使用virtualenv来安装。

  1. sudo pip install virtualenv
  2. virtualenv scrapyenv
  3. cd scrapyenv
  4. source bin/activate
  5. pip install Scrapy  

安装完成之后,安装如下包:

好了,可以使用scrapy startproject yourproject开始你的爬虫之旅了。

转自:http://blog.csdn.net/tangch0516/article/details/51378664

执行卸载和重装six的时候 not premitted

于是:

xcode-select --install

sudo pip install scrapy --ignore-installed six

然后错误:

ImportError:cannot import name xmlrpc_client
原因还是因为没有six

终端下执行

sudo rm -rf /Library/Python/2.7/site-packages/six*
sudo rm -rf /System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/six*
sudo pip install six

卸载掉six并重装,再次查看Scrapy版本,搞定。

如果执行第二条语句出错的话 就说明即便是sudo权限还是被拦截了

这时候:

重启电脑 进入 recovery mode (点击command+R) 在左上角的终端中 输入:csrutil disable

成功!

Last login: Thu Jan 12 21:39:41 on console

ChendeMacBook-Pro:~ Chen$ sudo rm -rf /Library/Python/2.7/site-packages/six*

Password:

ChendeMacBook-Pro:~ Chen$ sudo rm -rf /System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/six*

ChendeMacBook-Pro:~ Chen$ sudo pip install six

The directory '/Users/apple/Library/Caches/pip/http' or its parent directory is not owned by the current user and the cache has been disabled. Please check the permissions and owner of that directory. If executing pip with sudo, you may want sudo's -H flag.

The directory '/Users/apple/Library/Caches/pip' or its parent directory is not owned by the current user and caching wheels has been disabled. check the permissions and owner of that directory. If executing pip with sudo, you may want sudo's -H flag.

Requirement already satisfied: six in ./Library/Python/2.7/lib/python/site-packages

ChendeMacBook-Pro:~ Chen$ python

Python 2.7.10 (default, Oct 23 2015, 19:19:21)

[GCC 4.2.1 Compatible Apple LLVM 7.0.0 (clang-700.0.59.5)] on darwin

Type "help", "copyright", "credits" or "license" for more information.

>>> import scrapy

>>>

Mac OS安装Scrapy失败的更多相关文章

  1. Mac OS安装Scrapy

    个人觉得掌握简单的爬虫知识非常有用,特别是想要从一些特定网站自动地下载一些资源或者统计一些数据,非常的有用.对于产品经理来说,如果要了解竞争产品.替代产品的价格,可以写一个爬虫脚本从各大电商网站爬取相 ...

  2. Mac os安装DVWA环境教程

    Mac os安装DVWA环境教程 1.尽管Mac自带Apache和php 事实上Mac和WIN都用XAMPP一键化安装比较方便 2.解压DVWA-master 改名为dvwa移动到XAMPP的目录 3 ...

  3. mac OS 安装配置Nginx服务器

    系统环境 安装工具 Homebrew软件包管理器 :<mac OS 安装 Homebrew软件包管理器>https://blog.csdn.net/weixin_41791279/arti ...

  4. Mac OS安装Windows各版本时注意事项(2014年后的Mac机相信会有这些问题)

    2014年后的Mac Mini安装Windows时候,会遇上更种坑,我这几天不断失败及尝试更种版本,各有心得体会,我写下来是为了避免大家遇到像我这种问题. (2014年之前的Mac Mini是否这样, ...

  5. <亲测好使>mac os 安装mcrypt扩展

    以前安装opencart的时候倒是不需要mcrypt 这个库.但是新版本需要了.加上自己的 是mac环境.当时闲麻烦,就一直没装.这次下午就寻思给装上吧! 1.首先你要先安装xcode这个工具.不然没 ...

  6. YII 框架在 MAC OS下 连接数据库失败 提示 DB connection: SQLSTATE[HY000] [2002]

    作者:zccst CDbConnection failed to open the DB connection: SQLSTATE[HY000] [2002] No such file or dire ...

  7. Mac OS 安装Wget

    没有Wget的日子是非常难过的,强大的Mac OS 下安装Wget非常简单 下载一个Wget的源码包,http://www.gnu.org/software/wget/ 安装与配置 1. 首先下载一个 ...

  8. Mac OS安装octave出现的问题-'error:terminal type set to 'unknown'的解决'

    学习Machine learning需要使用Octave语言,毕竟Andrew Ng (恩达.吴)力荐.本机系统Mac OS X EI Capitan, 其实什么系统都无所谓了,安装原理都是一样的. ...

  9. Python 环境搭建(Win 安装以及Mac OS 安装)

    千里之行始于足下,今天我们先来学习 Python 环境搭建. 注意:本系列教程基于 Python 3.X Python 环境搭建 Win 安装 打开 Python 官网 https://www.pyt ...

随机推荐

  1. st link 连接问题ST LINK is not in the DFU mode plesse restart it

    原因:插上st link后做了一些操作才点击升级.如点击了连接stlink,如下图等: 解决办法: 1. 拔掉stlink 2. 插上stlink 3. 不要点其他的,直接点击ST-LINK-> ...

  2. Maximum sum

    描述 Given a set of n integers: A={a1, a2,-, an}, we define a function d(A) as below: t1 t2 d(A) = max ...

  3. postgresql 日期类型处理实践

    ---- 日期+1 select date '2018-01-14' + integer '1'; 结果: 2018-01-15 ---- 日期+1 后 转 20180101 日期字符串 select ...

  4. [Oracle]关于Oracle分页写法的性能分析及ROWNUM说明

    关于分页写法的性能分析及ROWNUM的补充说明 分页写法 一.测试前数据准备 SQL> SELECT COUNT(*) FROM BPM_PROCVAR; COUNT(*) ---------- ...

  5. JSON初体验(三):FastJson解析

    JSON解析之FastJson(阿里巴巴解析开源) 特点: Fastjson是一个Java语言编写的高性能功能完善的JSON库,它采用的 是一种"假定有序快速匹配"的算法,把JSO ...

  6. BZOJ1879_Bill的挑战_KEY

    题目传送门 第一次看题目感觉毫无还手之力,一看M的范围≤15,果断状压. 但是状压的想法比较新奇. 先想到的状压是设f[i][j]表示前i个状态为j时的方案总数,但是后来想了一想不行,会超时. 于是以 ...

  7. 使用cgroups来控制磁盘IO带宽

    磨砺技术珠矶,践行数据之道,追求卓越价值 回到上一级页面:PostgreSQL内部结构与源代码研究索引页    回到顶级页面:PostgreSQL索引页 [作者 高健@博客园  luckyjackga ...

  8. 洛谷P2252 取石子游戏(威佐夫博弈)

    题目背景 无 题目描述 有两堆石子,数量任意,可以不同.游戏开始由两个人轮流取石子.游戏规定,每次有两种不同的取法,一是可以在任意的一堆中取走任意多的石子:二是可以在两堆中同时取走相同数量的石子.最后 ...

  9. day 4 __all__ 包 __init__.py

    1.__all__的作用 如果一个文件中有__all__变量,那么也就意味着这个变量中的元素,不会被from xxx import *时导入 __all__ = ["test1", ...

  10. .net core中Primitives.StringValues 处理

    参考地址:https://stackoverflow.com/questions/36297329/primitives-stringvalues-how-to-deserialize-value-t ...