/usr/local/include/tk.h:71:13:致命错误:';X11/Xlib.h';安装python库时未找到文件
我有一个用于python的虚拟环境,正在尝试在虚拟环境中安装一些软件包:/usr/local/include/tk.h:71:13:致命错误:';X11/Xlib.h';安装python库时未找到文件,python,c++,matplotlib,virtualenv,Python,C++,Matplotlib,Virtualenv,我有一个用于python的虚拟环境,正在尝试在虚拟环境中安装一些软件包: sudo /Users/edamame/Library/python_virenv/bin/pip install matplotlib 然后我得到了以下错误: : : clang: warning: -framework Tcl: 'linker' input unused clang: warning: -framework Tk: 'linker' input unused In file includ
sudo /Users/edamame/Library/python_virenv/bin/pip install matplotlib
然后我得到了以下错误:
:
:
clang: warning: -framework Tcl: 'linker' input unused
clang: warning: -framework Tk: 'linker' input unused
In file included from src/_tkagg.cpp:28:
/usr/local/include/tk.h:71:13: fatal error: 'X11/Xlib.h' file not found
# include <X11/Xlib.h>
^
1 error generated.
error: command 'cc' failed with exit status 1
你知道我如何解决这个问题吗?谢谢 您应该安装X11的开发文件(从内存:libx11 dev),或者如果已经安装了这些文件,请将X11目录添加到include搜索路径
您可以使用
locate Xlib.h
确定文件是否已经存在。使用-I
编译器选项将目录添加到搜索路径。谢谢!事实上,我在Mac上,我已经在原来的问题中添加了额外的信息。嗯,我确信有一种方法可以在OSX上查找文件<代码>查找可能有效。或者您可以按照警告消息中的建议,运行sudo…
命令。我这样做了:ln-s/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.10.sdk/System/Library/Frameworks/Tk.framework/Versions/8.5/Headers/X11/usr/local/include/X11现在转到新错误。谢谢
edamame$ locate Xlib.h
WARNING: The locate database (/var/db/locate.database) does not exist.
To create the database, run the following command:
sudo launchctl load -w /System/Library/LaunchDaemons/com.apple.locate.plist
Please be aware that the database can take some time to generate; once
the database has been created, this message will no longer appear.