Sibte Raza Sibte Raza - 26 days ago 9
Python Question

Installation problems with Healpy python-3..4 on ubuntu-14.04

I am new to ubuntu and using ubuntu 14.04 on lenovo t410 with python-3.4 For installing Healpy I have followed following steps; I have installed pthon3-dev package using

sudo apt-get install python3-dev


and python-vm-builder by:

sudo apt-get install python-vm-builder


But when I install Healpy using the command:

pip install healpy


it gives me following error:

error: command 'i686-linux-gnu-gcc' failed with exit status 1

error code 1 in /tmp/pip_build_sibte/healpy
Traceback (most recent call last):
File "/usr/bin/pip", line 9, in <module>
load_entry_point('pip==1.5.4', 'console_scripts', 'pip')()
File "/usr/lib/python2.7/dist-packages/pip/__init__.py", line 185, in main
return command.main(cmd_args)
File "/usr/lib/python2.7/dist-packages/pip/basecommand.py", line 161, in main
text = '\n'.join(complete_log)
UnicodeDecodeError: 'ascii' codec can't decode byte 0xe2 in position 27: ordinal not in range(128)


Any help to solve the problem?

Answer

I have successfully installed healpy in Ubuntu 14.04 by downloading the python3-healpy package for Ubuntu 14.10 16.04 because the python3-healpy package is not available in Ubuntu 14.04. I installed python3-healpy in Ubuntu 14.04 using the following steps:

  1. Download dependencues of healpy. From http://packages.ubuntu.com/xenial/libcfitsio2 choose your architecture, select your mirror, and download libcfitsio2. From http://packages.ubuntu.com/xenial/libhealpix-cxx0v5 choose your architecture, select your mirror, and download libhealpix-cxx0v5.

  2. Download healpy. From http://packages.ubuntu.com/xenial/python3-healpy choose your architecture, select your mirror, and download python3-healpy

  3. Install dependencies. From the terminal run:

    sudo apt-get install libgomp1 python3-numpy python3-pyfits python3-six python3-matplotlib idle3 
    

    If any of these packages are already installed, the terminal will give you a message about which packages are already installed and install only the other packages.

  4. Install libcfitsio2. Browse to the folder where you downloaded the libcfitsio2_3.370-5 .deb file, double-click it to open it for installation in the Ubuntu Software Center, and install it.

  5. Install libhealpix-cxx0v5. Browse to the folder where you downloaded the libhealpix-cxx0_3.11.2-7.1 .deb file, double-click it to open it for installation in the Ubuntu Software Center, and install it.

  6. Install python-healpy_1.8.1-1.1. Browse to the folder where you downloaded the python-healpy_1.8.1-1.1 .deb file, double-click it to open it for installation in the Ubuntu Software Center, and install it.

  7. Test python3-healpy. Open IDLE3 and test python3-healpy by running the following simple Python code:

    import healpy as hp
    hp.pix2ang(16, 1440)
    

    This code should return the following output:

    (1.5291175943723188, 0.0)