安装完对Scrapy进行测试的时候发现了问题
scrapy -h
Fatal error in launcher: Unable to create process ...
第一次运行scrapy出现了上面的报错,原因是电脑中安装了多个python版本,所以导致报错。
解决方法就是指明使用的Python版本就好。我的Win10默认使用anaconda中的Python3,所以直接使用 python -m scrapy -h
命令就可以。不同的版本可以将 python
替换为 python2
或者 python3
进行调用即可
python -m scrapy -h
Scrapy 2.1.0 - no active project
Usage:
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 directory
Use "scrapy <command> -h" to see more info about a command