为什么在 Kubuntu 12.04 中安装 numpy 需要 python-dev

2022-01-24 00:00:00 python pip ubuntu debian

问题描述

刚开始在 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.

相关文章