Python命令行细分(用于“scrapy”)(Python command

编程入门 行业动态 更新时间:2024-10-26 22:18:16
Python命令行细分(用于“scrapy”)(Python command-line breakdown (for “scrapy”))

我试图安装SCRAPY并玩它。

教程说运行这个:

scrapy startproject tutorial

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

所以我尝试过:

\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

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

我在Google App Engine环境中习惯使用Python,因此在我的本地计算机上运行通常对我来说更具挑战性和陌生。

I was trying to install SCRAPY and play with it.

The tutorial says to run this:

scrapy startproject tutorial

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.

So I tried:

\python26_32bit\python.exe scrapy startproject tutorial

and I get the error:

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

I do see scrapy installed here: c:\Python26_32bit\Lib\site-packages\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?

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.py”文件

from scrapy.cmdline import execute execute()

并运行\python26_32bit\python.exe scrapy.py startproject tutorial

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.

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

from scrapy.cmdline import execute execute()

and run \python26_32bit\python.exe scrapy.py startproject tutorial

更多推荐

本文发布于:2023-08-06 04:13:00,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1444845.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:命令行   Python   command   scrapy

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!