sedavidw
sedavidw

Reputation: 11721

Installing numpy on Amazon EC2 virtualenv

I'm trying to build a virtualenv that uses python27 in a virtualenv on an Amazon EC2. Research on the web indicated messing with the preinstalled Python26 is a bad idea so I wanted to work in a safe virtual env. Here are all of my commands starting from a fresh instance on EC2

sudo easy_install python27
sudo easy_install virtualenv
yum groupinstall "Development Tools"
mkdir virt_env
virtualenv -p python27 virt_env/py27

And this all seems to work great. When I activate my virtualenv Python27 is the default, and outside of it Python26 is the default. So far so good. Next I tried iPython in the virtualenv

source virt_env/py27/bin/activate
pip install ipython

This works great, again ipython is available in the virtualenv and not available outside of it. However when I go to install numpy in the virtualenv I get the follwing:

pip install numpy
// Lots of output that I won't paste all of it, main error below
SystemError: Cannot compile 'Python.h'. Perhaps you need to install python-dev|python-devel.

Not sure what I'm doing wrong because I've always installed numpy on virtualenv this way. Any help would be greatly appreciated thanks

EDIT: I've also tried using:

sudo yum install python-devel

in the virtualenv. Still no help

Upvotes: 1

Views: 2929

Answers (1)

sedavidw
sedavidw

Reputation: 11721

Was able to answer my own question. To install the python dev correctly I needed:

sudo yum install python27-devel

Upvotes: 5

Related Questions