Issue with dependencies

Posted over 6 years ago by 546dtucgjvhkbj

Post a topic
Un Answered
5
546dtucgjvhkbj

Hello,

I add the UNIX timestamp to the item using an item pipeline. In essence, my code is:


import datetime

item['timestamp'] = datetime.datetime.now(datetime.timezone.utc())


Although datetime comes pre-installed with Python on my machine, it was not available on Scrapinghub, and, therefore, resulted in errors. I used the instructions ast https://support.scrapinghub.com/support/solutions/articles/22000200400-deploying-python-dependencies-for-your-projects-in-scrapy-cloud to include datetime as a dependency in the requirements.txt file. After deploying my project to Scrapinghub I got the error that now() does not exist in datetime.datetime.


What am I doing wrong here? Am I missing something?

0 Votes


1 Comments

nestor

nestor posted over 6 years ago Admin

What error or what problem did you encounter with Python's built-in datetime module?


Did you check the Meta parameter "_ts" https://doc.scrapinghub.com/scrapy-cloud.html#meta-parameters?

0 Votes

Login to post a comment