4

I am trying to install numpy on a remote host where I have no admin rights. I have sucessfully installed Python 2.7 and pip inside a virtualenv ,and can use pip to install trivial things like pip install Markdown. But if I pip install numpy or scipy, it errors on SystemError: Cannot compile 'Python.h'. Perhaps you need to install python-dev|python-devel. I do not have rights to sudo apt-get or apt-get, so can not do sudo apt-get install python27-devel or sudo apt-get install python-devel. I wanted to build from source so that I could use the option --user but the source is a .deb file and building it requires even more things I have to apt-get. I tried contacted the admin but I am advised to keep my own installations in my own local environment. What should I do? The OS system is Ubuntu 14.04 LTS.

1
  • Easiest way is to install Anaconda or some other prebuilt Python distribution, if the admin is not helpful enough to install python-devel Commented Jul 15, 2014 at 18:23

1 Answer 1

1

The reason for the admins answer is simple. Ubuntu also uses python for internal scripts. So the admin will not update or change the python installation if you need a more recent version of a package.

This is what I would try:

  1. Compile source of python 2.7 yourself and install it in your preferred path in your home directory. This way you always have all needed headers. Put the interpreter into your PATH.

(Optional) Set PYTHONUSERHOME to your local python site packages

  1. Install virtualenv package via pip
  2. Setup virtualenv envirnoment for numpy etc...

(Optional) 4. Build Blas libraries e.g. OpenBlas in your home

  1. Install cython in virtualenv ... and probably some more packages needed for numpy
  2. Install numpy scipy in the virtualenv with the correct settings BLAS libraries settings

If you use your own python installation, the virtualenv is not really necessary. So you might want to omit that. You just need to make sure that your python interpreter is always first to be found.

Sign up to request clarification or add additional context in comments.

Comments

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.