1

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

1 Answer 1

5

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

sudo yum install python27-devel
Sign up to request clarification or add additional context in comments.

2 Comments

@sedaviw. I am interested in this question and answer. Do you have sudo privileges to install software on the EC2 instances? Do you hae any pointers on where I can find more info on this?
@user815423426 When you start off an EC2 you do have sudo privileges. To install any given package you use sudo yum install <package>. If you have questions regarding a specific package you can generally google it and find explanations on how to install them

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.