/usr/local/include/tk.h:71:13: fatal error: 'X11/Xlib.h' file not found when install python library
<p>I have a virtual env for python, and trying to install some packages in the virtual-env:</p>

<pre><code>sudo /Users/edamame/Library/python_virenv/bin/pip install matplotlib
</code></pre>

<p>Then I got the following error:</p>

<pre><code>  :
  :
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 &lt;X11/Xlib.h&gt;

            ^

1 error generated.

error: command 'cc' failed with exit status 1
</code></pre>

<p>I am on Mac El-Captain, and I have:</p>

<pre><code>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.
</code></pre>

<p>Any idea how I can fix this problem? Thanks!</p>