【问题标题】:Can't install pybluez on mac OS无法在 Mac OS 上安装 pybluez
【发布时间】:2017-12-01 11:56:37
【问题描述】:

使用 Mac OS 版本 10.13.1 和 Python 3.6:

我已经安装成功了Python,但是当我在terminal.app中输入sudo pip3 install pybluez时,结果如下:

警告和错误信息。日志: (1) Command "/Library/Frameworks/Python.framework/Versions/3.6/bin/python3.6 -u -c "import setuptools, tokenize;__file__='/private/tmp/pip-build-01oswgn6/pybluez/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record /tmp/pip-ekqpt5n6-record/install-record.txt --single-version-externally-managed --compile" failed with error code 1 in /private/tmp/pip-build-01oswgn6/pybluez/

(2)Failed building wheel for pybluez (3)The directory '/Users/ringo/Library/Caches/pip/http' or its parent directory is not owned by the current user and the cache has been disabled. Please check the permissions and owner of that directory. If executing pip with sudo, you may want sudo's -H flag.

然后我用谷歌搜索并重新输入以下命令: sudo -H pip3 install pbluez,2个错误是: (1)Failed building wheel for pybluez (2)Command "/Library/Frameworks/Python.framework/Versions/3.6/bin/python3.6 -u -c "import setuptools, tokenize;__file__='/private/tmp/pip-build-krv0pwmm/pybluez/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record /tmp/pip-38mly9ts-record/install-record.txt --single-version-externally-managed --compile" failed with error code 1 in /private/tmp/pip-build-krv0pwmm/pybluez/

我在谷歌上搜索过,没有有效的方法解决这个问题。任何人对此有任何想法表示赞赏。

【问题讨论】:

    标签: python macos installation pybluez


    【解决方案1】:

    Bluez 是“官方 Linux 蓝牙协议栈”,即不适用于 macOS。

    如果您想为 macOS 目标开发蓝牙应用程序,请查看https://developer.apple.com/bluetooth/

    【讨论】:

    • 我之前已经成功安装了包pybluez,但是由于mac os(mac OS Hight Sierra)的版本,当我使用这个包扫描附近的设备时出现了问题。
    猜你喜欢
    • 2019-01-09
    • 1970-01-01
    • 1970-01-01
    • 2016-07-05
    • 2018-12-06
    • 2021-06-23
    • 2011-01-02
    • 2017-11-02
    • 2011-05-04
    相关资源
    最近更新 更多