Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/python/279.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
/usr/local/include/tk.h:71:13:致命错误:';X11/Xlib.h';安装python库时未找到文件_Python_C++_Matplotlib_Virtualenv - Fatal编程技术网

/usr/local/include/tk.h:71:13:致命错误:';X11/Xlib.h';安装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

我有一个用于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 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.