make:在pkg-config搜索路径中找不到包python

时间:2017-09-19 07:39:35

标签: python makefile pip

$ make
pip install runcython
Requirement already satisfied: runcython in d:\programfiles\conda\lib\site-packages
Requirement already satisfied: Cython>=0.10 in d:\programfiles\conda\lib\site-packages (from runcython)
makecython++ stitch_wrapper.pyx "" "stitch_rects.cpp ./hungarian/hungarian.cpp"
Package python was not found in the pkg-config search path.
Perhaps you should add the directory containing `python.pc'
to the PKG_CONFIG_PATH environment variable
No package 'python' found
stitch_wrapper.cpp:4:20: fatal error: Python.h: No such file or directory
 #include "Python.h"
                    ^
compilation terminated.
make: *** [all-python2] Error 1

尝试编译一些用c ++编写的util,但得到这个错误:

  

在pkg-config搜索路径中找不到包python。

Utils文件夹包含.cpp和.py文件(也用于Python)

我有python 3.6.1

  

make:*** [all-python2]错误1

似乎它想要python 2。

但我不确定在安装python 2. *并将其添加到系统变量之后问题将会消失。谁知道肯定?

更新

虽然makefile有python 3行:

SHELL := /bin/bash

.PHONY: all-python2 all-python3
all-python2:
    pip install runcython
    makecython++ stitch_wrapper.pyx "" "stitch_rects.cpp ./hungarian/hungarian.cpp"

all-python3:
    pip3 install runcython3
    makecython3++ stitch_wrapper.pyx "" "stitch_rects.cpp ./hungarian/hungarian.cpp"

1 个答案:

答案 0 :(得分:1)

对于我在Arch Linux(4.15.11-1)上,makecython也无法找到python.pc。 我检查了pkg-config --variable pc_path pkg-config,发现相应的搜索路径只包含文件python3.pcpython2.pc

所以我使用sudo ln -s /usr/lib/pkgconfig/python3.pc /usr/lib/pkgconfig/python.pc添加了一个符号链接,现在一切正常。