mac安装scrapy并创建项目
来源:互联网 发布:python 自动发送邮件 编辑:程序博客网 时间:2024/06/05 14:30
最近刚好在学习python+scrapy的爬虫技术,因为mac是自带python2.7的,所以安装3.5版本有两种方法,一种是升级,一种是额外安装3.5版本。
升级就不用说了,讲讲额外安装的版本吧~~~
因为python是有自带版本的,最开始安装的时候都会有一种“ 会不会冲突 ”的感觉。
其实安装3.5版本也就是在官网上直接下载之后安装,和普通的mac软件安装方式是一样的~~
https://www.python.org/downloads/release/python-353/
安装完成之后,不会覆盖原来的python,会在 /Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5文件中
在终端直接输入 python 会执行python2.7版本
pythonPython 2.7.12 (default, Jun 29 2016, 14:05:02)[GCC 4.2.1 Compatible Apple LLVM 7.3.0 (clang-703.0.31)] on darwinType "help", "copyright", "credits" or "license" for more information.>>>
在终端直接输入 python3 则会执行python3.5版本
python3Python 3.5.3 (v3.5.3:1880cb95a742, Jan 16 2017, 08:49:46)[GCC 4.2.1 (Apple Inc. build 5666) (dot 3)] on darwinType "help", "copyright", "credits" or "license" for more information.>>>
接下来就可以开始安装scrapy了
python3.5中会自带 pip,所以不需要额外安装了,可以直接在终端输入 pip3 --version查看版本和路径
pip3 --versionpip 9.0.1 from /Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/site-packages (python 3.5)
pip3 install Scrapy
这里的Scrapy一定要首字母大写,不然会在安装的过程中报错~~
Collecting scrapy Retrying (Retry(total=4, connect=None, read=None, redirect=None)) after connection broken by 'NewConnectionError('<pip._vendor.requests.packages.urllib3.connection.VerifiedHTTPSConnection object at 0x103aa2c88>: Failed to establish a new connection: [Errno 61] Connection refused',)': /simple/scrapy/ Retrying (Retry(total=3, connect=None, read=None, redirect=None)) after connection broken by 'NewConnectionError('<pip._vendor.requests.packages.urllib3.connection.VerifiedHTTPSConnection object at 0x103aa29e8>: Failed to establish a new connection: [Errno 61] Connection refused',)': /simple/scrapy/ Retrying (Retry(total=2, connect=None, read=None, redirect=None)) after connection broken by 'NewConnectionError('<pip._vendor.requests.packages.urllib3.connection.VerifiedHTTPSConnection object at 0x103aa2630>: Failed to establish a new connection: [Errno 61] Connection refused',)': /simple/scrapy/ Retrying (Retry(total=1, connect=None, read=None, redirect=None)) after connection broken by 'NewConnectionError('<pip._vendor.requests.packages.urllib3.connection.VerifiedHTTPSConnection object at 0x103aa2f28>: Failed to establish a new connection: [Errno 61] Connection refused',)': /simple/scrapy/ Retrying (Retry(total=0, connect=None, read=None, redirect=None)) after connection broken by 'NewConnectionError('<pip._vendor.requests.packages.urllib3.connection.VerifiedHTTPSConnection object at 0x103aa2be0>: Failed to establish a new connection: [Errno 61] Connection refused',)': /simple/scrapy/ Could not find a version that satisfies the requirement scrapy (from versions: )No matching distribution found for scrapy
安装成功之后,可以直接在终端上输入 scrapy 查看版本号及使用
Scrapy 1.4.0 - no active projectUsage: scrapy <command> [options] [args]Available commands: bench Run quick benchmark test fetch Fetch a URL using the Scrapy downloader genspider Generate new spider using pre-defined templates runspider Run a self-contained spider (without creating a project) settings Get settings values shell Interactive scraping console startproject Create new project version Print Scrapy version view Open URL in browser, as seen by Scrapy [ more ] More commands available when run from project directoryUse "scrapy <command> -h" to see more info about a command
在pycharm中是没有直接创建scrapy项目的,可以使用 scrapy 命令手动新建项目
scrapy startproject ArticleSpider(ArticleSpider为项目名称)
阅读全文
0 0
- mac安装scrapy并创建项目
- React Natvie在Mac os上安装并创建项目
- mac上安装并使用maven创建web项目
- 简单创建scrapy项目并生成egg包
- Mac 安装 Scrapy
- Mac OS安装Scrapy
- mac安装scrapy
- Mac 安装Scrapy
- Mac 安装scrapy框架
- Mac OS安装Scrapy
- Mac 下安装scrapy
- Mac上安装scrapy
- mac 下安装Scrapy
- MAC 安装Scrapy
- Mac 安装 Scrapy (python3)
- Mac OS安装Scrapy
- scrapy创建项目详解
- scrapy创建项目
- 微信小程序25
- 博客笔记:自定义View之绘图(1)--drawText
- 正则表达式里的参数 g、m、i 的一些作用
- 微信小程序26
- LR连续特征离散化
- mac安装scrapy并创建项目
- 微信小程序27
- Solr 6.5.1 SolrCloud windows使用zk安装集群
- Python自然语言分析(第四期):第1课书面作业
- 微信小程序28
- python 多进程并发与多线程并发总结
- wdcp如何修改phpmyadmin导入 最大限制2048 KB
- 嵌入式linux 字节对齐 导致输出Alignment trap
- LeetCode Binary Tree Level Order Traversal