简体   繁体   English

/usr/local/include/tk.h:71:13:致命错误:安装python库时找不到'X11 / Xlib.h'文件

[英]/usr/local/include/tk.h:71:13: fatal error: 'X11/Xlib.h' file not found when install python library

I have a virtual env for python, and trying to install some packages in the virtual-env: 我有一个用于python的虚拟环境,并尝试在virtual-env中安装一些软件包:

sudo /Users/edamame/Library/python_virenv/bin/pip install matplotlib

Then I got the following error: 然后我得到以下错误:

  :
  :
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

I am on Mac El-Captain, and I have: 我在Mac El-Captain上,并且拥有:

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.

Any idea how I can fix this problem? 您知道如何解决此问题吗? Thanks! 谢谢!

You should either install the development files for X11 (from memory: libx11-dev), or if they are already installed, add the X11 directory to your include search path. 您应该安装X11的开发文件(来自内存:libx11-dev),或者如果已经安装了这些文件,则将X11目录添加到包含搜索路径中。

You can use locate Xlib.h to figure out if the files are already there. 您可以使用locate Xlib.h来确定文件是否已经存在。 Use the -I compiler option to add directories to your search path. 使用-I编译器选项将目录添加到搜索路径。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 pip 安装 uwsgi 失败,出现 /usr/local/include/string/string.h:7:10:致命错误:找不到“流”文件? - pip install uwsgi failed with /usr/local/include/string/string.h:7:10: fatal error: 'sstream' file not found? 无法在 Mac 上安装 async-sqlalchemy(致命错误:找不到“Python.h”文件#include“Python.h”) - Can not install async-sqlalchemy on Mac (fatal error: 'Python.h' file not found #include "Python.h") /usr/include/boost/python/detail/wrap_python.hpp:50:23:致命错误:pyconfig.h:没有这样的文件或目录 - /usr/include/boost/python/detail/wrap_python.hpp:50:23: fatal error: pyconfig.h: No such file or directory Pycrypto 安装致命错误:找不到 gmp.h 文件 - Pycrypto install fatal error: gmp.h file not found make pycaffe致命错误:找不到&#39;Python.h&#39;文件 - make pycaffe fatal error: 'Python.h' file not found 致命错误:安装时找不到“Python.h”文件 opencv - fatal error: 'Python.h' file not found while installing opencv 尽管已安装开发包,但找不到tk.h - Cannot find tk.h despite having the dev packages installed Ubuntu,致命错误:Python.h: No such file or directory #include<Python.h> - Ubuntu, fatal error: Python.h: No such file or directory #include <Python.h> C 致命错误:Python.h:没有这样的文件或目录#include<Python.h> - C fatal error: Python.h: No such file or directory #include <Python.h> 致命错误:使用 pyenv 时找不到“arrayobject.h”文件 - fatal error: 'arrayobject.h' file not found when using pyenv
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM