Pymongo import error

Posted over 4 years ago by cireyennek

Post a topic
Answered
c
cireyennek

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?


0 Votes

nestor

nestor posted over 4 years ago Admin Best Answer

Try:


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


requirements_file was deprecated a while ago

0 Votes


4 Comments

Sorted by
nestor

nestor posted over 4 years ago Admin

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

0 Votes

c

cireyennek posted over 4 years ago

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.

0 Votes

nestor

nestor posted over 4 years ago Admin

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

0 Votes

nestor

nestor posted over 4 years ago Admin Answer

Try:


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


requirements_file was deprecated a while ago

0 Votes

Login to post a comment