How can I install matplotlib for my AWS Elastic Beanstalk application?

前端 未结 3 1946
孤城傲影
孤城傲影 2020-12-31 19:52

I\'m having a hell of a time deploying matplotlib on AWS Elastic Beanstalk. I gather that my issue comes from some dependencies and the way that EB deploys packages installe

3条回答
  •  清歌不尽
    2020-12-31 20:47

    I might be a bit late to this question, but as AWS and a lot of the cloud service providers are moving into Docker and taking into consideration that you haven't specified the platform . I have a fast solution to your question:

    1. Use the generic docker platform.
    2. I created some images with Python, Numpy, Scipy and Matplotlib preinstalled, so you can directly pull and start using them with one line of code.

    Python 2.7(This one also has the versions that you were specifying for numpy and matplotlib)

    sudo docker pull chuseuiti/pynuscimat2.7
    

    Python 3.4

    sudo docker pull chuseuiti/pynusci
    

    However you can create your own image or modify existing images.

    In case you want to automate your instances, you can pass a Dockerfile to AWS with the definition of your image.

    Tip, in case you don't know about docker:

    It is need to login before been able to pull:

    sudo docker login
    

    After pulling the image, you can generate and work in a container created from an image with the next code:

     sudo docker run -i -t chuseuiti/pynuscimat2.7 bash
    

    PS. At least with the free tier AWS is always complaining about running out of time with scipy and matplotlib, it takes too much time to install them, that is why I use this option.

提交回复
热议问题