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 ...
随机推荐
- 邮箱,ip,叠词的正则处理方式
package com.regexTest; import java.util.TreeSet; public class RegexTest { public static void main(St ...
- openstack之kvm常用操作
KVM虚拟机的管理主要是通过virsh命令对虚拟机进行管理. 1. 查看KVM虚拟机配置文件及运行状态 KVM虚拟机默认配置文件位置: /etc/libvirt/qemu/ autostart目录 ...
- thinkphp3.2.3 HTML 页面跳转
1. http://域名/index.php(入口文件)/模块/控制器/方法 2.{:U('控制器/方法')}
- Hive--关联表(join)
在hive中,关联有4种方式: 内关联:join on 左外关联:left join on 右外关联:right join on 全外关联:full join on 另外还有一种可实现hive笛卡儿积 ...
- 隐藏Windows不常用设置项
Windows10的设置里面有很多我们不想看见的项目,例如"轻松使用","隐私","游戏","Cortana"等,我们可 ...
- git小技巧之分支、关联远程仓库、回滚、解决.gitignore不生效等
1.分支管理 新建并切换分支:git checkout -b <name>新建本地分支并关联到远程分支git checkout -b myRelease origin/Release合并某 ...
- python爬xx图代码
今日 好热,照样是挖洞挖不到,看了几天的python爬虫,学会了xpath解析 撸一个代码玩玩] 不要说什么,优化之类的,刚学完,跑了一阵 ,还可以 挺稳定 # -*- coding:utf-8 - ...
- [原创]利用python构造ICMP Echo Request并发送
import socket import struct def checksum(source_string): sum = 0 countTo = (len(source_string)/2)*2 ...
- PHP.48-TP框架商城应用实例-后台23-权限管理-权限验证
权限验证 1.登录控制器 2.通过tp验证码类生成验证码图片 3.在管理员模型增加登录验证规则 4.后台中所有的控制器必须先登录才能访问 思路:在访问任何一个控制器之前都判断一个session即可,= ...
- P1488 肥猫的游戏
题目描述 野猫与胖子,合起来简称肥猫,是一个班的同学,他们也都是数学高手,所以经常在一起讨论数学问题也就不足为奇了.一次,野猫遇到了一道有趣的几何游戏题目,便拿给胖子看.游戏要求在一个有n个顶点凸多边 ...