conda安装scrapy及一些报错解决方法

conda虚拟环境创建&进入虚拟环境

参考前面写的一篇博客:https://blog.****.net/zimojiang/article/details/103869843

安装Scrapy框架

conda install scrapy

错误重现

输入scrapy之后出现如下错误:

Fatal error in launcher: Unable to create process using
'“d:\bld\scrapy_1572360388337_h_env\python.exe”
“D:\Anaconda3\envs\learn2\Scripts\scrapy.exe”

解决办法

前面加上python -m 表示将scrapy 作为包引用

(base) C:\Users\HP>activate learn2

(learn2) C:\Users\HP>scrapy
Fatal error in launcher: Unable to create process using '“d:\bld\scrapy_1572360388337_h_env\python.exe” “D:\Anaconda3\envs\learn2\Scripts\scrapy.exe” ’

(learn2) C:\Users\HP>python -m scrapy
Scrapy 1.8.0 - no active project

Usage:
scrapy [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 -h” to see more info about a command
conda安装scrapy及一些报错解决方法