videocamWeb Data Extraction Summit - September 30th, 2021.
Join some of the greatest minds in web scraping to educate, inspire, and innovate.
Register for free!
Start a new topic
Answered

Pymongo import error

When I run my spider, I get the error:


ImportError: No module named pymongo

 


I have set up a dependency in my .yml file. It looks like:


project:
  default: 431098
requirements_file: requirements.txt

The only line in my requirements.txt file is:

 

pymongo==3.8.0

 


This is my folder setup:


image


Any ideas on what I'm doing wrong?



Best Answer

Try:


projects:
  default: 12345
requirements:
  file: requirements.txt


requirements_file was deprecated a while ago


Answer

Try:


projects:
  default: 12345
requirements:
  file: requirements.txt


requirements_file was deprecated a while ago

Another thing is that you have "project: default" it should be "projects: default"

Thanks for the response. I made the suggested adjustments. While I'm no longer getting the import error, I'm now getting a configuration error: 

ConfigurationError: The "dnspython" module must be installed to use mongodb+srv:// URIs

 I've done some searching and I'm not able to find any documentation on how to address that error.

You need to add dnspython too to your requirements.txt it seems.

Login to post a comment