[AstroPy] Installation error

Erik Bray embray at stsci.edu
Mon Dec 21 12:56:06 EST 2015


Hi Daniel,

For installing most non-trivial Python packages (i.e. anything containing C 
code) on Linux you will need the Python-dev package, which is not always 
installed by default:

$ sudo apt-get install python-dev

Erik

On 12/21/2015 12:50 PM, Daniel M. Faes wrote:
> Dear all,
> I'm trying to install astropy in my Ubuntu system, and I getting the following
> error (below).
> Cheers,
> Daniel
>
>
> - - -
> creating build/temp.linux-x86_64-2.7/astropy
>
> x86_64-linux-gnu-gcc -pthread -fno-strict-aliasing -DNDEBUG -g -fwrapv -O2 -Wall
> -Wstrict-prototypes -fPIC -I/usr/include/python2.7 -c astropy/_compiler.c -o
> build/temp.linux-x86_64-2.7/astropy/_compiler.o
>
> astropy/_compiler.c:1:20: fatal error: Python.h: File or directory not found
>
>   #include <Python.h>
>
>                      ^
>
> compilation terminated.
>
> error: command 'x86_64-linux-gnu-gcc' failed with exit status 1
>
> ----------------------------------------
> Cleaning up...
> Command /usr/bin/python -c "import setuptools,
> tokenize;__file__='/tmp/pip_build_root/astropy/setup.py';exec(compile(getattr(tokenize,
> 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))"
> install --record /tmp/pip-nXWLvE-record/install-record.txt
> --single-version-externally-managed --compile failed with error code 1 in
> /tmp/pip_build_root/astropy
> 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 235, 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 0xc3 in position 69: ordinal
> not in range(128)
> = = =
>
>
> _______________________________________________
> AstroPy mailing list
> AstroPy at scipy.org
> https://mail.scipy.org/mailman/listinfo/astropy
>




More information about the AstroPy mailing list