为什么在 Kubuntu 12.04 中安装 numpy 需要 python-dev [英] Why does installing numpy require python-dev in Kubuntu 12.04

查看:34
本文介绍了为什么在 Kubuntu 12.04 中安装 numpy 需要 python-dev的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

刚开始在 pendrive 12.04 Kubuntu 环境中使用 python.我必须安装 GCC(明白这一点),但我还必须安装 python-dev 才能使用 PIP 安装 numpy.为什么我需要 python-dev?

Just starting out in python on a pendrive 12.04 Kubuntu environment. I had to install GCC (understand that), but I also had to install python-dev before I could use PIP to install numpy. Why do I need python-dev?

sudo apt-get install gcc
sudo apt-get install pip
cd /usr/lib/python2.7/
sudo apt-get install python-dev
sudo pip install numpy

推荐答案

当你使用 pip 安装 numpy 时,包是从源代码编译的.pythonx.x-dev 包包含链接 python 所需的头文件.

When you use pip to install numpy, the packages is compiled from source. The pythonx.x-dev packages contain the necessary header files for linking against python.

这篇关于为什么在 Kubuntu 12.04 中安装 numpy 需要 python-dev的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆