Python 命令行分解(用于“scrapy") [英] Python command-line breakdown (for "scrapy")

查看:41
本文介绍了Python 命令行分解(用于“scrapy")的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图安装 SCRAPY 并使用它.

I was trying to install SCRAPY and play with it.

教程说要运行这个:

   scrapy startproject tutorial

能否请您分解一下以帮助我理解它.我在我的 Windows 7 机器上有各种版本的 Python 用于各种冲突的项目,所以当我用他们的 .exe 安装 Scrapy 时,它安装在 c:\Python26_32bit 目录中,这没关系.但是我的路径中没有任何一个版本的 Python.

Can you please break this down to help me understand it. I have various releases of Python on my Windows 7 machine for various conflicting projects, so when I installed Scrapy with their .exe, it installed it in c:\Python26_32bit directory, which is okay. But I don't have any one version of Python in my path.

所以我尝试了:

\python26_32bit\python.exe scrapy startproject tutorial 

我得到错误:

\python26_32bit\python.exe: can't open file 'scrapy': [Errno 2] No such file or directory. 

我确实看到这里安装了scrapy:c:\Python26_32bit\Lib\site-packages\scrapy

I do see scrapy installed here: c:\Python26_32bit\Lib\site-packages\scrapy

我找不到任何名为scrapy.py的文件,那么Python术语中的scrapy"究竟是什么,一个库,一个站点包,一个程序,??以及如何更改上面的示例以运行?

I cannot find any file called scrapy.py, so what exactly is "scrapy" in Python terminology, a lib, a site-package, a program, ?? and how do I change the sample above to run?

我更习惯于 Google App Engine 环境中的 Python,因此在我的本地机器上运行对我来说通常更具挑战性和陌生感.

I'm a little more used to Python in Google App Engine environment, so running on my local machine is often more challenging and foreign to me.

推荐答案

scrapy 是一个批处理文件,它执行名为scrapy"的 python 文件,因此您需要将文件scrapy"的路径添加到您的 PATH 环境中.

scrapy is a batch file which execute a python file called "scrapy", so you need to add the file "scrapy"'s path to your PATH environment.

如果还是不行,制作带有内容的scrapy.py"文件

if that is still not work, make "scrapy.py" file with content

from scrapy.cmdline import execute
execute()

并运行\python26_32bit\python.exe scrapy.py startproject教程

这篇关于Python 命令行分解(用于“scrapy")的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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