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


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

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.

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

Answer

Try:


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


requirements_file was deprecated a while ago

Login to post a comment