I've added deploy commands to my Elastic Beanstalk deployment which download the Anaconda installer, and install it into /anaconda
. Everything goes well, but I cannot seem to correctly modify the PATH of my instance to include /anaconda/bin
as suggested by the Anaconda installation page. If I SSH into an instance and manually add it, everything works fine. But this is obviously not the correct approach, as machines will be added automatically by EB.
So my question is: how can I use Anaconda in my script?
A couple more details:
- I've tried adding
/anaconda/bin
to the system PATH all ways I can think of. Pre/post deploy scripts, custom environment variables, etc. It seems that no matter what I do, the modifications don't persist to when the application is run. - I've tried to include Anaconda via adding it to sys.path:
sys.path.append('/anaconda/bin')
to no avail. Using the following:sys.path.append('/anaconda/lib/python2.7/site-packages')
allows me to import some packages but fails onimport pandas
. Strangely enough, if I SSH into the instance and run the application with their python (/opt/python/run/venv/bin/python2.7
) it runs fine. Am I going crazy? Why does it fail on a specific import statement when run via EB?