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

2024-09-22 14:33:38 发布

您现在位置:Python中文网/ 问答频道 /正文

我有一个python的虚拟env,并试图在virtual env中安装一些包:

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

然后我得到了以下错误:

^{pr2}$

我在麦克尔船长,我有:

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.

你知道我怎么解决这个问题吗?谢谢!在


Tags: installpiptheenvbinmatplotlib错误library
1条回答
网友
1楼 · 发布于 2024-09-22 14:33:38

您应该安装X11的开发文件(来自内存:libx11dev),或者如果已经安装了这些文件,请将X11目录添加到include搜索路径中。在

您可以使用locate Xlib.h来判断文件是否已经存在。使用-I编译器选项将目录添加到搜索路径中。在

相关问题 更多 >