My paths environment in windows 7:
C:\Python37\Scripts\;
C:\Python37\;
C:\Python37\Scripts\scrapy.exe;
C:\Python37\Lib\site-packages\scrapy
Few days ago, without modified stuffs since, I used to run my spider like this:
py scrapy crawl spider -a arg1=truc -a arg2=machin
I run it in the project spider as C:\\Users\\Truc\\FolderA\\FolderB\\FolderC\\...\\spiders
it worked well, no problem, but today by a magic I obtain this message:
C:\Python37\python.exe: can't open file 'scrapy': [Errno 2] No such file or directory
How is it possible when I did not change anything?
I did try the solution of @YOU in this topic , so create a .py
file in C:\\Users\\Truc\\FolderA\\FolderB\\FolderC\\...\\spiders
edited it as said, and obtain this error:
Traceback (most recent call last):
File "scrapy.py", line 1, in <module>
from scrapy.cmdline import execute
File "C:\Users\Truc\FolderA\FolderB\FolderC\...\spiders\scrapy.py", line 1, in <module>
from scrapy.cmdline import execute
ModuleNotFoundError: No module named 'scrapy.cmdline'; 'scrapy' is not a package
I did check if there is cmdline
and there is, but 'scrapy' is not a package
is this weird.
如果可以导入scrapy,请在python REPL中进行测试。
将py scrapy
更改为仅在通话中scrapy
。
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.