本文介绍了Healpy python-3..4 在 ubuntu-14.04 上的安装问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我是 ubuntu 的新手,在 lenovo t410 上使用 ubuntu 14.04 和 python-3.4 为了安装 Healpy,我遵循了以下步骤;我已经使用

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

和 python-vm-builder 来自:

and python-vm-builder by:

    sudo apt-get install python-vm-builder

但是当我使用以下命令安装 Healpy 时:

But when I install Healpy using the command:

    pip install healpy

它给了我以下错误:

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)

对解决问题有帮助吗?

推荐答案

在 Ubuntu 14.10 及更高版本中,可以从默认的 Ubuntu 存储库安装 python3-healpy.打开终端并输入:

In Ubuntu 14.10 and later, python3-healpy can be installed from the default Ubuntu repositories. Open the terminal and type:

sudo apt install python3-healpy

我已经通过下载适用于 Ubuntu 16.04 的 python3-healpy 包在 Ubuntu 14.04 中成功安装了healpy,因为 python3-healpy 包在 Ubuntu 14.04 中不可用.我使用以下步骤在 Ubuntu 14.04 中安装了 python3-healpy:

I have successfully installed healpy in Ubuntu 14.04 by downloading the python3-healpy package for Ubuntu 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. 下载healpy的依赖.从 http://packages.ubuntu.com/xenial/libcfitsio2 选择您的架构,选择您的镜像,并下载 libcfitsio2.从 http://packages.ubuntu.com/xenial/libhealpix-cxx0v5 选择您的架构,选择您的镜像,然后下载 libhealpix-cxx0v5.

  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.

下载健康.从 http://packages.ubuntu.com/xenial/python3-healpy 选择您的架构,选择你的镜像,然后下载 python3-healpy

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

安装依赖项.从终端运行:

Install dependencies. From the terminal run:

sudo apt 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.

安装 libcfitsio2.浏览到下载 libcfitsio2_3.370-5 .deb 文件的文件夹,在 Ubuntu 软件中心双击打开进行安装,然后安装.

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.

安装 libhealpix-cxx0v5.浏览到下载 libhealpix-cxx0_3.11.2-7.1 .deb 文件的文件夹,在 Ubuntu 软件中心双击打开安装,安装.

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.

安装 python-healpy_1.8.1-1.1.浏览到你下载python-healpy_1.8.1-1.1 .deb文件的文件夹,在Ubuntu软件中心双击打开安装,安装

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.

测试 python3-healpy.打开 IDLE3 并通过运行以下简单的 Python 代码测试 python3-healpy:

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)

这篇关于Healpy python-3..4 在 ubuntu-14.04 上的安装问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

09-18 19:23