#StackBounty: #ubuntu #amazon-ec2 #datascience-anaconda Ubuntu Cronjob can't execute conda environment

Bounty: 50

Whenever I login to my ec2 Ubuntu instance my terminal is like this

(base) ubuntu@ip-xx-xx-xx

When I run my Python script which is converted from a Jupyter notebook with the default conda environment the script runs perfect. The problem starts when I try to make a cronjob.

When the instance starts(I will try to explain as best I can), the ipython that runs the script can’t find the packages. Because it’s the default conda environment I thought all I have to do is somehow activate the source bash so but everything failed, what I’ve tried so far

  • I’ve tried to exec bash
  • I’ve tried to add to SHELL the bash
  • I’ve tried to source bash
  • I’ve tried to run ipython directly from conda environment

At this point I don’t know what I am missing.
All I want, is when the instance start to “activate” the conda environment and with ipython run the script

Get this bounty!!!

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.