python - 如何使用 pip 在 mac OS 上安装 mecab-python3

标签 python python-3.x macos anaconda mecab

我正在尝试通过 pip install mecab-python3 安装 mecab-python3,但出现以下错误。

Collecting mecab-python3
Using cached https://files.pythonhosted.org/packages/e2/02/d35d4342a37a36f953939d098bc1d38928932b62907a54d4a1aa9c37da9b/mecab-python3-0.8.1.tar.gz
Complete output from command python setup.py egg_info:
Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "/private/var/folders/rz/m973jrzs5nv6x_h26ys14nxm0000gp/T/pip-install-nr4vtspq/mecab-python3/setup.py", line 6, in <module>
    with open('README.rst') as readme_file:
FileNotFoundError: [Errno 2] No such file or directory: 'README.rst'

----------------------------------------
Command "python setup.py egg_info" failed with error code 1 in /private/var/folders/rz/m973jrzs5nv6x_h26ys14nxm0000gp/T/pip-install-nr4vtspq/mecab-python3/

仅供引用,这里是 pip 的版本:pip 18.1 from/Users/XXX/.pyenv/versions/anaconda3-5.2.0/lib/python3.6/site-packages/pip (python 3.6)

谁能帮帮我?


已更新。

按照mmedina的评论,出现如下错误。

/Users/XXX/.pyenv/versions/anaconda3-5.2.0/lib/gcc/x86_64-apple-darwin11.4.2/4.8.5/include-fixed/limits.h:168:61: fatal error: limits.h: No such file or directory
#include_next <limits.h>  /* recurse down to the real one */
                                                         ^
error: command 'gcc' failed with exit status 1

最佳答案

终于可以解决这个问题了。原因是 MacOS Mojave。

许多与 gcc 问题相关的帖子都说“运行 xcode-select --install”。

但是,在 MacOS Mojave 上,我们需要运行

sudo installer -pkg/Library/Developer/CommandLineTools/Packages/macOS_SDK_headers_for_macOS_10.14.pkg -target/

因为目前 xcode-select 跟不上 MacOS Mojave。

关于python - 如何使用 pip 在 mac OS 上安装 mecab-python3,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/53041400/

相关文章:

python - Python 3 中的哈希文件?

python - 使用 Playwright 获取影子 DOM 元素后面的元素文本

Python正确有效地获取DBUS对象路径(例如/org/bluez/dev_XX_XX_XX_XX_XX_XX/playerY)

python - 验证datefield,以便它不会在Django中使用将来的日期?

python - 写入文本文件时出现奇怪的空字符

Swift - 如何正确获取 CPU 负载

cocoa - Mac OS X : strikethrough the text in a label (NSTextField)

node.js - 无法从本地网络上的不同设备访问 Mac 上的 Node 服务器

python - 通过多索引的子集从 pandas 中选择行

python - 无 Python 错误/错误?