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 ...
随机推荐
- django的render的特殊用法
以前都是将模板渲染好, 传输到前端, 但是现在前后端分离了, 模板渲染引擎还有用, 而且很好用. 比如在渲染一个表格的时候, 每一行都有两个操作按钮, 并且这个按钮上是有a标签的 你可以使用字符串拼接 ...
- Elasticsearch 映射操作
一.创建 语法: PUT /索引库名称/_mapping/类型名称 { "properties": { "字段名": { "type": 类 ...
- curl下载文件
* curl下载文件* 根据业务需求* 通过不同站点去访问路径* 下载文件* 但是不同站点需要设置header头* 这里使用curl方式下载* 具体看代码: //下载地址 $url = 'https: ...
- php http_build_query stream_context_create post请求
<?php function send_post($url, $post_data) { $postdata = http_build_query($post_data); $options = ...
- Flask后台管理
管理后台主页 需求 为后台主页提供专门的视图函数 需要带入当前管理员用户相关信息以便在界面进行展示 代码实现 在 modules/admin/views.py 文件中添加视图函数 @admin_blu ...
- 2017Facebook面试题改编“一面砖墙 ”
题目:一面砖墙 这道题改编自网上Facebook去年的一道面试题,是hihoCoder的1494题(https://hihocoder.com/problemset/problem/1494) 这道题 ...
- 全国各大城市Uber客服联系方式(电话、邮箱、微博)
滴快车单单2.5倍,注册地址:http://www.udache.com/ 如何注册Uber司机(全国版最新最详细注册流程)/月入2万/不用抢单:http://www.cnblogs.com/mfry ...
- 百度地图 ver2.0 api
百度地图JavaScript API是一套由JavaScript语言编写的应用程序接口,可帮助您在网站中构建功能丰富.交互性强的地图应用,支持PC端和移动端基于浏览器的地图应用开发,且支持HTML5特 ...
- 封装一个Automapper单例
public class DataModule : IModule { public void Configure(IMapperConfigurationExpression cfg) { //cf ...
- MySQL高级-索引优化
索引失效 1. 2.最佳左前缀法则 4. 8. 使用覆盖索引解决这个问题. 二.索引优化 1.ORDER BY 子句,尽量使用Index方式排序,避免使用FileSort方式排序 MySQL支持两种方 ...