无法在mac OS上安装pybluez

时间:2017-12-01 11:56:38

标签: python macos install pybluez

使用Mac OS Ver 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.

然后我用Google搜索并重新输入以下命令: 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/

我用谷歌搜索并且没有有效的方法解决这个问题。任何人都对它有任何了解。

1 个答案:

答案 0 :(得分:0)

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

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