gpt4 book ai didi

python - 我在哪里可以找到我的 -I/usr/local 目录?

转载 作者:行者123 更新时间:2023-12-04 19:21:38 25 4
gpt4 key购买 nike

我正在尝试运行此代码示例以在 Ubuntu 12.04 上测试 swig。我的系统上安装了 python 2.7.3。此代码似乎适用于联网机器。如何找到我的 python 的安装位置以及我应该用什么替换这些目录路径?

cc -c example.c example_wrap.c \
-I/usr/local/include/python1.5 \
-I/usr/local/lib/python1.5/config

最佳答案

您可以将这些行替换为 python-config --includes它会自动为编译器和您安装的 python 版本创建正确的语句。 python-config本身是通过python-dev安装的,如果您还没有安装它,您将需要它。

因此,在命令行上调用编译器:

cc -c example.c example_wrap.c $(python-config --cflags) -fPIC

还有,python1.5?你在哪里找到那个例子?

关于python - 我在哪里可以找到我的 -I/usr/local 目录?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/16505732/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com