I’m trying to add analytics to my first Twitter bot and to do that, I need to use the pandas and matplotlib packages in Python. Trying to install these on my Amazon EC2 instance revealed an unpleasant thing about the Amazon Linux package manager: it’s updated like the decor in my local bodega is updated, hardly ever.
Running the recommended “sudo yum install python-matplolib” was a bust. It installs the Python 2.6 version rather than the standard Python 2.7. I have to run “pip install matplotlib”, but that fails with the error “Command “python setup.py egg_info” failed with error code 1″.
Finally, after Googling around and parsing the error messages, I finally figured out the sequence to install matplotlib and pandas:
Amazon Linux is a great basic OS for doing simple tasks, but there just doesn’t seem to be a lot of documentation that stays current. There wasn’t any one post that put everything in one place and most of the examples were borrowed from Ubuntu or Debian. I had to Google the package name for the development versions of libpng and freetype in yum. “sudo yum install python-matplotlib” should just work, but until (if) that happens, hopefully this gist will be helpful to anyone else trying to setup an EC2 instance for data science work.
why not just run ubuntu on your ec2 instance?
On Amazon EC2 just do this for python2.7
sudo yum install python27-matplotlib
I was having trouble getting pandas to work on Amazon Linux. This worked great. Thank you!
Pingback: Installing matplotlib and pandas on Amazon EC2 | harvey1993
Worked for me. I’ve struggle whole day with requirements.txt and matplotlib. Thanks
after hours of work, this finally actually worked for me. thank you.
Pingback: Coding-Your-Life » » Pandas und Matplotlib auf Amazon EC2 installieren
All worked well except the last step where I got MemoryError!
This first comment here is also useful:
http://stackoverflow.com/questions/19580038/how-to-install-pandas-through-ssh-on-ec2-instance/42794857#42794857
Thanks so much for the nice guide. It helped a lot, especially that I have been trying for a while to figure the issue.
Keep up the good work!