Import Error--Scrapy. Basespider.

383 views
Skip to first unread message

Kristin Brown

unread,
May 24, 2010, 4:37:32 PM5/24/10
to scrapy-users
The turtorial calls for you to import Base spider by using the
command, "from scrapy.spider import BaseSpider." I run this and I keep
geting the error

Traceback (most recent call last):
File "D:\Python Documents\dmoz\stackexchange\stackexchange\spiders
\stackexchange_spider.py", line 1, in <module>
from scrapy.spider import BaseSpider
ImportError: No module named scrapy.spider

It cant find the module I am trying to Import.I have looked through
the files on my computer and I cannot find them either. I know i have
the path and class path right, they are set to python26\scripts, and I
am pretty sure that I downloaded everything the install guide said.
Also, when i try to run it in command prompt i get the error " Could
not fine spider for the domain: dmoz.org"

Any ideas?

Kristin

--
You received this message because you are subscribed to the Google Groups "scrapy-users" group.
To post to this group, send email to scrapy...@googlegroups.com.
To unsubscribe from this group, send email to scrapy-users...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/scrapy-users?hl=en.

Rolando Espinoza La Fuente

unread,
May 24, 2010, 6:24:22 PM5/24/10
to scrapy...@googlegroups.com
On Mon, May 24, 2010 at 4:37 PM, Kristin Brown <naca...@gmail.com> wrote:
> The turtorial calls for you to import Base spider by using the
> command, "from scrapy.spider import BaseSpider." I run this and I keep
> geting the error
>
> Traceback (most recent call last):
>  File "D:\Python Documents\dmoz\stackexchange\stackexchange\spiders
> \stackexchange_spider.py", line 1, in <module>
>    from scrapy.spider import BaseSpider
> ImportError: No module named scrapy.spider
>
> It cant find the module I am trying to Import.I have looked through
> the files on my computer and I cannot find them either.  I know i have
> the path and class path right, they are set to python26\scripts, and I
> am pretty sure that I downloaded everything the install guide said.
> Also, when i try to run it in command prompt i get the error " Could
> not fine spider for the domain: dmoz.org"

Are you running the spider with scrapy-ctl.py?

Is scrapy installed in python26\scripts?
If so, you should have
python26\scripts
|- scrapy
|- lot of directories here

Try reinstalling the scrapy exe.

~Rolando

Kristin Brown

unread,
May 24, 2010, 7:02:39 PM5/24/10
to scrapy...@googlegroups.com
Yes, I am. and yes it is. There isnt a scrapy folder in the scripts section, but there are scrapy programs in it. I have tried reinstaling it already. I am supposed to specify that it be installed in the scripts folder when I install scrapy?  When I try to run it I use the statement scrapy-ctl.py crawl dmoz.org.

Rolando Espinoza La Fuente

unread,
May 24, 2010, 7:24:04 PM5/24/10
to scrapy...@googlegroups.com
On Mon, May 24, 2010 at 7:02 PM, Kristin Brown <naca...@gmail.com> wrote:
> Yes, I am. and yes it is. There isnt a scrapy folder in the scripts section,
> but there are scrapy programs in it. I have tried reinstaling it already. I
> am supposed to specify that it be installed in the scripts folder when I
> install scrapy?  When I try to run it I use the statement scrapy-ctl.py
> crawl dmoz.org.

PYTHONPATH should point where scrapy modules are.

go into python26\scripts and run: scrapy-ctl.py --version
If it displays "0.8" scrapy is installed correctly.

from there, you should start the tutorial. here is the steps in brief:

python26\scripts\> python scrapy-ctl.py dmoz
python26\scripts\> cd dmoz\dmoz\spiders
python26\scripts\dmoz\dmoz\spiders\> edit dmoz_spider.py
python26\scripts\dmoz\dmoz\spiders\> cd ..\..
python26\scripts\dmoz\> python scrapy-ctl.py crawl dmoz.org

Hope it helps.

Kristin Brown

unread,
May 24, 2010, 7:38:37 PM5/24/10
to scrapy...@googlegroups.com
No, the python path is set correctly and when I run that command the version comes out to .8. I have altered the file to run on a different domain/site than dmoz, but that should not be an issue. It saying that it cannot even find the spider I created nor import base spider. I must have something set wrong or something but I cannot figure out what it is.

Kristin
Reply all
Reply to author
Forward
0 new messages