docker中的python虚拟环境中的GCC错误

时间:2018-12-12 08:16:42

标签: python docker gcc pip virtualenv

我有一个docker文件,其中我正在python 2.7.15中创建虚拟环境并为我的项目安装所有必需的python依赖项。

某些依赖项要求gcc像熊猫一样进行编译,lz4 ..失败并出现以下错误,

http://example.com/wp-json/wp/v2/posts?filter[category_name]=$categoryName

即使我在docker中也安装了python-devel,gcc也很累。但这无济于事。

 pandas/io/sas/sas.c:4:20: fatal error: Python.h: No such file or directory
     #include "Python.h"
                        ^
    compilation terminated.
    error: command 'gcc' failed with exit status 1

Dockerfile:

RUN yum install -y python-pip python-devel gcc

我该如何解决这个问题。

1 个答案:

答案 0 :(得分:1)

我想你应该:

  1. 安装python开发文件(如注释中建议)。
  2. -I命令行中使用gcc开关为python包含文件指向正确的路径。