简体   繁体   中英

PyInstaller filenotfounderror and cannot import name only when run as systemd service

I'm running a number of compiled PyInstaller applications as systemd services on Debian.

This works fine over ssh:

systemctl start service_name

However, if I enable these to run on boot, ie

systemctl enable service_name

I get all the common file not found errors, ie:

FileNotFoundError: 'cacert.pem' resource not found in 'certifi'

Is it normal the PyInstaller doesnt work with systemd services?

After 8 hours of trying, adding this to crontab fixes the problem:

TEMP=/home/admin/
@reboot sleep 5 && /home/admin/app

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM