I added deployment commands to my Elastic Beanstalk deployment, which download the Anaconda installer and install it on /anaconda. Everything is going well, but I cannot correctly change the PATH of my instance to include /anaconda/bin, as suggested on the Anaconda installation page. If I SSH into the instance and add it manually, everything will be fine. But this is obviously not the right approach, as the machines are automatically added EB.
So my question is: how can I use Anaconda in my script?
A couple more details:
- I tried adding
/anaconda/binPATH to the system in every way that I can think of. Pre / post deployment scripts, custom environment variables, etc. It seems that no matter what I do, the changes are not saved when the application starts. - I tried to enable Anaconda by adding it to sys.path:
sys.path.append('/anaconda/bin')
but to no avail. Using the following: sys.path.append('/anaconda/lib/python2.7/site-packages')allows me to import some packages but crashes on import pandas. Oddly enough, if I SSH into an instance and run the application with their python ( /opt/python/run/venv/bin/python2.7), it works fine. I'm out of my mind? Why does this happen when a particular import statement is executed when executed through EB?