gpt4 book ai didi

python - 找不到文件

转载 作者:行者123 更新时间:2023-11-30 04:01:51 27 4
gpt4 key购买 nike

我正在使用 Xcode。我在这台新 Mac 上遇到错误: 'Python.h' file not found.在行: #include <Python.h>

当我输入 sudo find / -name "Python.h" 时在命令行中,我可以看到它存在很多版本,甚至在 Xcode 中也是如此。

/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.8.sdk/System/Library/Frameworks/Python.framework/Versions/2.5/include/python2.5/Python.h
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.8.sdk/System/Library/Frameworks/Python.framework/Versions/2.6/include/python2.6/Python.h
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.8.sdk/System/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7/Python.h
find: /dev/fd/3: Not a directory
find: /dev/fd/4: Not a directory
/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7/Python.h
/System/Library/Frameworks/Python.framework/Versions/2.5/include/python2.5/Python.h
/System/Library/Frameworks/Python.framework/Versions/2.6/include/python2.6/Python.h
/System/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7/Python.h

有人知道发生了什么事吗?是我没有正确设置 Xcode 吗?

最佳答案

您需要设置“Python.h”所在的包含路径。

详细操作请引用以下网址的问题“如何在xcode工程中设置include路径”。

How to set include path in xcode project

关于python - 找不到文件 <Python.h>,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/25517915/

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