首页 > 解决方案 > “python setup.py install”自定义依赖位置

问题描述

我目前正在尝试安装与 libyaml 链接的自定义 pyyaml 版本,以测试我的代码执行时间如何从提供的额外性能中受益(如https://pyyaml.org/wiki/PyYAMLDocumentation中所建议)。我已经按照文档中的说明安装了 libyaml

./bootstrap && ./configure --prefix /my/install/location

但是当我为 pyyaml 运行安装时

python setup.py --with-libyaml install

我明白了

creating build/temp.linux-x86_64-2.7/ext
/usr/bin/gcc -fno-strict-aliasing -g -O2 -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -fPIC -I/usr/bin/python2.7 -c ext/_yaml.c -o build/temp.linux-x86_64-2.7/ext/_yaml.o
gcc: error: ext/_yaml.c: No such file or directory
gcc: fatal error: no input files

如何将安装指向/my/install/location?有没有办法扩展搜索路径以包含额外的位置,或者是否有另一种方式可以将其组合在一起?

标签: pythondistutilspyyamllibyaml

解决方案


推荐阅读