如何在不同版本的python中使用scrapy [英] How do I use scrapy in different versions of python

查看:43
本文介绍了如何在不同版本的python中使用scrapy的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在终端输入'scrapy crawl PROJECT_NAME'并尝试运行一个用python2编码的项目,但终端尝试在python3中使用scrapy并不断报告错误(我有python2/3的scrapy库).

I enter 'scrapy crawl PROJECT_NAME' in terminal and try to run a project coded with python2 but terminal tries to use scrapy in python3 and keeps reporting error(I have scrapy library for both python2/3).

它起初可以识别我项目的python版本.但是现在不行了.

It could recognise python version of my project at first. But it fails to work now.

推荐答案

只需指定你想要运行 scrapy 的 python:

Just specify the python you want to run scrapy with:

python2 -m scrapy crawl PROJECT_NAME

或者更精确:

/path/to/python/executable/python -m scrapy crawl PROJECT_NAME

这篇关于如何在不同版本的python中使用scrapy的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆