0

I create a project with scrapy and using pymongo save my data to mongodb.

I have checked my pymongo version is 3.5.1

When i deploy my project to scrapinghub and run it.

It shows error on scrapinghub exceptions.ImportError: No module named pymongo

I have created requirements.txt and scrapinghub.yml. enter image description here

enter image description here

Why it shows error exceptions.ImportError: No module named pymongo ? enter image description here Any help would be appreciated. Thanks in advance.

enter image description here

Morton
  • 5,380
  • 18
  • 63
  • 118

1 Answers1

1

You have the format of requirements.txt which did not work for me too.

Please try this format instead

projects:
  default: 111149
requirements:
  file: requirements.txt

Also generate a temporary requirements file by pip freeze > temp_req.txt and see how your pymongo module is written inside that file, copy exact same line and put that into requirements.txt

Umair Ayub
  • 19,358
  • 14
  • 72
  • 146
  • Thanks for your reply, i have changed the format like yours, and type command `pip freeze > temp_req.txt` under my project. I can see `pymongo==3.5.1`. I run my project again still get `exceptions.ImportError: No module named pymongo` :( – Morton Nov 06 '17 at 12:23
  • Did you delete your old build and project egg folder before redeploying it – Umair Ayub Nov 06 '17 at 13:38
  • What do you mean project egg folder ? Do you mean requirements.txt and scrapinghub.yml files ? – Morton Nov 06 '17 at 15:26
  • The `project.egg-info` and `build` folders – Umair Ayub Nov 06 '17 at 15:26
  • Oh i see it , no i don't. Should i delete it before deploying it again ? – Morton Nov 07 '17 at 00:47
  • I have deleted `project.egg-info` folder now. And when i deploy it again , i still get error `No module named pymongo` :( Its confused with me. – Morton Nov 07 '17 at 05:24