Mac OS安装Scrapy失败
报错:
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来安装。
sudo pip install virtualenvvirtualenv scrapyenvcd scrapyenvsource bin/activatepip 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失败的更多相关文章
- Mac OS安装Scrapy
个人觉得掌握简单的爬虫知识非常有用,特别是想要从一些特定网站自动地下载一些资源或者统计一些数据,非常的有用.对于产品经理来说,如果要了解竞争产品.替代产品的价格,可以写一个爬虫脚本从各大电商网站爬取相 ...
- Mac os安装DVWA环境教程
Mac os安装DVWA环境教程 1.尽管Mac自带Apache和php 事实上Mac和WIN都用XAMPP一键化安装比较方便 2.解压DVWA-master 改名为dvwa移动到XAMPP的目录 3 ...
- mac OS 安装配置Nginx服务器
系统环境 安装工具 Homebrew软件包管理器 :<mac OS 安装 Homebrew软件包管理器>https://blog.csdn.net/weixin_41791279/arti ...
- Mac OS安装Windows各版本时注意事项(2014年后的Mac机相信会有这些问题)
2014年后的Mac Mini安装Windows时候,会遇上更种坑,我这几天不断失败及尝试更种版本,各有心得体会,我写下来是为了避免大家遇到像我这种问题. (2014年之前的Mac Mini是否这样, ...
- <亲测好使>mac os 安装mcrypt扩展
以前安装opencart的时候倒是不需要mcrypt 这个库.但是新版本需要了.加上自己的 是mac环境.当时闲麻烦,就一直没装.这次下午就寻思给装上吧! 1.首先你要先安装xcode这个工具.不然没 ...
- YII 框架在 MAC OS下 连接数据库失败 提示 DB connection: SQLSTATE[HY000] [2002]
作者:zccst CDbConnection failed to open the DB connection: SQLSTATE[HY000] [2002] No such file or dire ...
- Mac OS 安装Wget
没有Wget的日子是非常难过的,强大的Mac OS 下安装Wget非常简单 下载一个Wget的源码包,http://www.gnu.org/software/wget/ 安装与配置 1. 首先下载一个 ...
- Mac OS安装octave出现的问题-'error:terminal type set to 'unknown'的解决'
学习Machine learning需要使用Octave语言,毕竟Andrew Ng (恩达.吴)力荐.本机系统Mac OS X EI Capitan, 其实什么系统都无所谓了,安装原理都是一样的. ...
- Python 环境搭建(Win 安装以及Mac OS 安装)
千里之行始于足下,今天我们先来学习 Python 环境搭建. 注意:本系列教程基于 Python 3.X Python 环境搭建 Win 安装 打开 Python 官网 https://www.pyt ...
随机推荐
- web开发问题汇总
Meta基础知识: H5页面窗口自动调整到设备宽度,并禁止用户缩放页面 //一.HTML页面结构 <meta name="viewport" content="wi ...
- Flask基本介绍
Fask 1.Flask简介 Flask是一个基于Python开发并且依赖jinja2模板和Werkzeug WSGI服务的一个微型框架对于Werkzeug本质是socket服务端,其用于接收http ...
- Python学习知识库
2017年10月16日 1. too broad exception clause 捕获的异常过于宽泛了,没有针对性,应该指定精确的异常类型场景: def check_data_type(column ...
- Docker入门系列02
上篇用一个简单的示例,简单的介绍了 Dockerfile 的配置及其相关的命令.这一篇会在上篇的示例程序里,继续添加新代码及如何将单元测试也放入 Image 建立过程内. 首先,我们需要建一个新的类库 ...
- postgresql 日期类型处理实践
---- 日期+1 select date '2018-01-14' + integer '1'; 结果: 2018-01-15 ---- 日期+1 后 转 20180101 日期字符串 select ...
- WebService第二天——WebService框架CXF
一.CXF 1.什么是CXF Apache CXF = Celtix + XFire,开始叫 Apache CeltiXfire,后来更名为 Apache CXF 了,以下简称为 CXF.CXF 继承 ...
- 北京Uber优步司机奖励政策(3月4日)
滴快车单单2.5倍,注册地址:http://www.udache.com/ 如何注册Uber司机(全国版最新最详细注册流程)/月入2万/不用抢单:http://www.cnblogs.com/mfry ...
- 杭州优步uber司机第三组奖励政策
-8月9日更新- 优步杭州第三组: 定义为激活时间在2015/8/3之后(含)的车主(以优步后台数据显示为准) 滴滴快车单单2.5倍,注册地址:http://www.udache.com/如何注册Ub ...
- springboot 常用依赖
<?xml version="1.0" encoding="UTF-8"?><project xmlns="http://maven ...
- oradebug 的学习 一
说明 oradebug主要是给oracle支持人员使用的,尽管很早便有,但oracle官网很少有记载.他是个sql*plus命令行工具,有sysdba的权限就可以登入,无需特别设置.他可以被用 ...