Harrison Harrison - 5 months ago 26
Python Question

Scrapy extensions directory permission issue

I made a custom extension in

Scrapy
, and it's in folder
extensions
(
extensions
is in the project folder which contains
spider
folder,
pipelines.py
, etc). It works on
Cloud9
, but got this error message once I uploaded it to my server:

ImportError: No module named extensions.my_extension


The path in my
settings.py


EXTENSIONS = {
'wow.extensions.my_extension.MyExtensionClass': 500,
}


I guess it's related to the directory permission, as it will work if I move the extension file to the project directory (same directory of pipelines.py) and change the
settings.py
accordingly.

Folder permission is 755 and extension file is 664, both of them are same on
cloud9
.

Thanks.

Answer

Finally, I found out the answer. It has nothing to do with permissions, all I need to do is to make an empty __init__.py file.