简体   繁体   English

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

[英]make: Package python was not found in the pkg-config search path

$ 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

Trying to compile some utils written in c++, but get this error: 尝试编译一些用C ++编写的utils,但出现此错误:

Package python was not found in the pkg-config search path. 在pkg-config搜索路径中找不到python软件包。

Utils folder includes .cpp and .py files (uses also Python for something) Utils文件夹包含.cpp和.py文件(也使用Python进行处理)

I have python 3.6.1 我有python 3.6.1

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

Seems it wants python 2. 似乎需要python 2。

But I'm not sure if after installing python 2.* and adding it to system variables issue will disappear . 但是我不确定在安装python 2. *并将其添加到系统变量后是否会消失。 Who know for sure? 谁能确定?

update 更新

though makefiles has python 3 lines: 尽管makefiles具有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"

For me on Arch Linux (4.15.11-1), makecython was unable to find python.pc too. 对我而言,在Arch Linux(4.15.11-1)上,makecython也无法找到python.pc I checked pkg-config --variable pc_path pkg-config and found out that the respective searchpath only contained the files python3.pc and python2.pc . 我检查了pkg-config --variable pc_path pkg-config ,发现相应的搜索路径仅包含文件python3.pcpython2.pc

So I added a symlink using sudo ln -s /usr/lib/pkgconfig/python3.pc /usr/lib/pkgconfig/python.pc and now everything is working fine. 所以我使用sudo ln -s /usr/lib/pkgconfig/python3.pc /usr/lib/pkgconfig/python.pc添加了一个符号链接,现在一切正常。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM