Question

Trouble installing NumPy in virtualenv on Ubuntu 14.04

Yesterday was my first day using DigitalOcean. I set up Ubuntu v. 14.04, cloned the repository my colleague and I are working on, and tried to install all the required Python modules and non-Python dependencies, but there were problems with NumPy that I could not resolve. I have not used Ubuntu in some months, but I normally use pip for almost all Python installations, within a virtualenv virtual environment, and install the many dependencies using apt-get.

I remember that NumPy often presents problems. This time it seemed impossible to make NumPy compile. Installing with root privileges succeeded, but then NumPy was not available within the virtualenv environment.

I have now installed the Anaconda distribution, instead, so that I can move forward, but I’d be glad to hear of suggestions for effective NumPy installation using pip within a virtual environment.


Submit an answer

This textbox defaults to using Markdown to format your answer.

You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

Sign In or Sign Up to Answer

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

Without seeing the error, it’s hard to say exactly what went wrong. Though one thing to remember is that installing numpy with pip requires compiling <br>C code, so you need gcc and Python’s developmental headers around: <br> <br>apt-get install python-dev build-essential <br> <br>Also, if you want your virtualenv to be able to access packages installed through apt, create it using: <br> <br>virtualenv --system-site-packages your_enev

This comment has been deleted