Got this cron, which run some scrapy code
* * * * * cd /var/projects/project-1/scrappers && python3 runner.py
It return this error on the logs
Continue with error: [Errno 2] No such file or directory: 'scrapy'
Scrapy is correctly installed and working fine as if I run the same command from the cli, with the same user, it works.
I being looking for a solution to this triying few aproaches from the last days and can't understand why is not working, any idea?
Debian version:
Distributor ID: Debian
Description: Debian GNU/Linux 12 (bookworm)
Release: 12
Codename: bookworm
Update 1
More details related to the commens:
Cron is running as the same user as the one I use on the CLI
This server was configured using cloud-config and scrapy installation looks like this
- wget https://bootstrap.pypa.io/get-pip.py
- rm /usr/lib/python3.11/EXTERNALLY-MANAGED
- python3 get-pip.py
- pip3 install scrapy
On the CLI I got this when doing type scrapy
type scrapy
scrapy is /usr/local/bin/scrapy
But if I add type scrapy as part of the cron it returns scrapy not found which make sense based on the error
scrapyan executable file? If so: What is the output oftype scrapy/which scrapy?PATHfor cron which would explain the issue. This is a comment, and not an answer, since I'm not sure what a suitable fix is.PATHto the crontab config file and now is working, as it explains on this answer: stackoverflow.com/a/14694543/4886775 If you want to make an answer I mark it as the solution