在通过安装 readline 时构建 readline 的 c 扩展时pip install readline
,我收到如下错误消息:-
Beginning configuration for readline-6.2 for i386-apple-darwin11.3.0
checking whether make sets $(MAKE)... yes
checking for gcc... gcc
checking for C compiler default output file name...
configure: error: in `/Users/calvin/.virtualenvs/myproj/build/readline/rl/readline-lib':
configure: error: C compiler cannot create executables
See `config.log' for more details.
============ Building the readline library ============
============ Building the readline extension module ============
running install
running build
running build_ext
building 'readline' extension
Compiling with an SDK that doesn't seem to exist: /Developer/SDKs/MacOSX10.7.sdk
在我的系统上搜索 MacOSX10.7.sdk 的位置显示:-
calvin$ sudo find / -name "MacOSX10.7.sdk"
Password:
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.7.sdk
find: /dev/fd/3: Not a directory
find: /dev/fd/4: Not a directory
这不是 readline 编译所期望的。
pip 如何定位 MacOSX10.7.sdk 是否存在错误?
如何在不将 MacOSX10.7 复制到/Developer/SDKs
目录中的情况下解决此问题?
澄清
这就是我暂时解决问题的方法。
calvin$ sudo mkdir -p /Developer/SDKs/
Password:
calvin$ sudo ln -s /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.7.sdk /Developer/SDKs/MacOSX10.7.sdk
calvin$ pip install readline
但我不太确定这是解决它的“适当”方法,因为 pip 应该如何定位我的 .sdk 位置或我的系统 PATH 中缺少某些内容可能存在一些固有问题。因此,任何有关如何以“适当”方式解决此问题的建议将不胜感激!