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 ...
随机推荐
- Python文本和字符串常用操作
## 字符串分割 line = "This is my love!" fields = line.split(' ') print(fields) # ['This', 'is', ...
- Windows常用命令,想要看什么命令直接在全文“CTRL+F”检索(转)
原文地址:https://www.cnblogs.com/kekec/p/3662125.html 打开"运行"对话框(Win+R),输入cmd,打开控制台命令窗口... 也可以通 ...
- [Doctrine Migrations] 数据库迁移组件的深入解析二:自定义集成
自定义命令脚本 目录结构 目前的项目结构是这样的(参照代码库): 其中,db/migrations文件夹是迁移类文件夹,config/db.php是我们项目原有的db配置,migrations.php ...
- 学习 Git的使用过程
原文链接: http://www.cnblogs.com/NickQ/p/8882726.html 学习 Git的使用过程 初次使用 git config --global user.name &qu ...
- Python学习笔记四:列表,购物车程序实例
列表 切片 中括号,逗号分隔,可以一次取出多个元素,起始位置包括,结束位置不包括(顾头不顾尾) 如果取最后一个,而且不知道列表长度,可以使用负数(-1是最后一个,以此类推) 如果取最后几个,记住从左往 ...
- C++远征离港篇-学习笔记
C++远征离港篇 离港总动员 C++远征计划的学习者肯定是冲着封装,继承,多态来的. 知识点: 指针 VS 引用 #define VS const(更强数据控制力) 函数默认值 & 函数重载 ...
- 20145209 2016-2017-2 《Java程序设计》第9周学习总结
20145209 2016-2017-2 <Java程序设计>第9周学习总结 教材学习内容总结 JDBC简介 撰写应用程序是利用通信协议对数据库进行指令交换,以进行数据的增删查找 JDBC ...
- java 中的线程池和线程 调用小demo
public class Main { public static void main(String[] args) { try { /// ThreadPoolExecutor executor = ...
- LeetCode:40. Combination Sum II(Medium)
1. 原题链接 https://leetcode.com/problems/combination-sum-ii/description/ 2. 题目要求 给定一个整型数组candidates[ ]和 ...
- oracle_列转行
wmsys.wm_concat 将表中数据 如 ID USERNAME TYPE 1 刘 下 1 刘 ...