- c - 在位数组中找到第一个零
- linux - Unix 显示有关匹配两种模式之一的文件的信息
- 正则表达式替换多个文件
- linux - 隐藏来自 xtrace 的命令
我尝试使用以下命令安装 pybluez。
pip install pybluez
sudo easy_install pybluez
但是对于这两个命令,我最终都出错了。
环境:
Mac OSX 10.9.1
Python 2.7
Pip 日志:
cc -fno-strict-aliasing -fno-common -dynamic -arch x86_64 -arch i386 -g -Os -pipe -fno-common -fno-strict-aliasing -fwrapv -mno-fused-madd -DENABLE_DTRACE -DMACOSX -DNDEBUG -Wall -Wstrict-prototypes -Wshorten-64-to-32 -DNDEBUG -g -fwrapv -Os -Wall -Wstrict-prototypes -DENABLE_DTRACE -arch x86_64 -arch i386 -pipe -I/System/Library/Frameworks/IOBluetooth.framework/Headers -I/System/Library/Frameworks/CoreFoundation.framework/Headers -I/System/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7 -c osx/_osxbt.c -o build/temp.macosx-10.9-intel-2.7/osx/_osxbt.o
clang: warning: argument unused during compilation: '-mno-fused-madd'
osx/_osxbt.c:676:5: error: unknown type name 'IOBluetoothDeviceInquiryRef'; did you mean 'IOBluetoothDeviceRef'?
IOBluetoothDeviceInquiryRef inquiry;
^~~~~~~~~~~~~~~~~~~~~~~~~~~
IOBluetoothDeviceRef
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.9.sdk/System/Library/Frameworks/IOBluetooth.framework/Headers/IOBluetoothUserLib.h:34:47: note: 'IOBluetoothDeviceRef' declared here
typedef struct OpaqueIOBluetoothObjectRef * IOBluetoothDeviceRef;
^
osx/_osxbt.c:688:17: error: unknown type name 'IOBluetoothDeviceInquiryRef'; did you mean 'IOBluetoothDeviceRef'?
IOBluetoothDeviceInquiryRef inquiryRef,
^~~~~~~~~~~~~~~~~~~~~~~~~~~
IOBluetoothDeviceRef
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.9.sdk/System/Library/Frameworks/IOBluetooth.framework/Headers/IOBluetoothUserLib.h:34:47: note: 'IOBluetoothDeviceRef' declared here
typedef struct OpaqueIOBluetoothObjectRef * IOBluetoothDeviceRef;
^
osx/_osxbt.c:703:19: warning: implicit declaration of function 'IOBluetoothDeviceInquiryCreateWithCallbackRefCon' is invalid in C99 [-Wimplicit-function-declaration]
dd->inquiry = IOBluetoothDeviceInquiryCreateWithCallbackRefCon (&dd);
^
osx/_osxbt.c:703:17: warning: incompatible integer to pointer conversion assigning to 'IOBluetoothDeviceRef' (aka 'struct OpaqueIOBluetoothObjectRef *') from 'int' [-Wint-conversion]
dd->inquiry = IOBluetoothDeviceInquiryCreateWithCallbackRefCon (&dd);
^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
osx/_osxbt.c:705:5: warning: implicit declaration of function 'IOBluetoothDeviceInquirySetCompleteCallback' is invalid in C99 [-Wimplicit-function-declaration]
IOBluetoothDeviceInquirySetCompleteCallback (dd->inquiry,
^
osx/_osxbt.c:717:5: warning: implicit declaration of function 'IOBluetoothDeviceInquiryStart' is invalid in C99 [-Wimplicit-function-declaration]
IOBluetoothDeviceInquiryStart (dd->inquiry);
^
osx/_osxbt.c:721:5: warning: implicit declaration of function 'IOBluetoothDeviceInquiryDelete' is invalid in C99 [-Wimplicit-function-declaration]
IOBluetoothDeviceInquiryDelete (dd->inquiry);
^
5 warnings and 2 errors generated.
error: command 'cc' failed with exit status 1
----------------------------------------
Cleaning up...
Removing temporary dir /private/var/folders/f0/ldyq8xbx0fvckg001kk64j7r0000gn/T/pip_build_~...
Command /usr/bin/python -c "import setuptools, tokenize;__file__='/private/var/folders/f0/ldyq8xbx0fvckg001kk64j7r0000gn/T/pip_build_~/pybluez/setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /var/folders/f0/ldyq8xbx0fvckg001kk64j7r0000gn/T/pip-j1ASQD-record/install-record.txt --single-version-externally-managed --compile failed with error code 1 in /private/var/folders/f0/ldyq8xbx0fvckg001kk64j7r0000gn/T/pip_build_~/pybluez
Exception information:
Traceback (most recent call last):
File "/Library/Python/2.7/site-packages/pip-1.5.2-py2.7.egg/pip/basecommand.py", line 122, in main
status = self.run(options, args)
File "/Library/Python/2.7/site-packages/pip-1.5.2-py2.7.egg/pip/commands/install.py", line 279, in run
requirement_set.install(install_options, global_options, root=options.root_path)
File "/Library/Python/2.7/site-packages/pip-1.5.2-py2.7.egg/pip/req.py", line 1380, in install
requirement.install(install_options, global_options, *args, **kwargs)
File "/Library/Python/2.7/site-packages/pip-1.5.2-py2.7.egg/pip/req.py", line 699, in install
cwd=self.source_dir, filter_stdout=self._filter_install, show_stdout=False)
File "/Library/Python/2.7/site-packages/pip-1.5.2-py2.7.egg/pip/util.py", line 697, in call_subprocess
% (command_desc, proc.returncode, cwd))
InstallationError: Command /usr/bin/python -c "import setuptools, tokenize;__file__='/private/var/folders/f0/ldyq8xbx0fvckg001kk64j7r0000gn/T/pip_build_~/pybluez/setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /var/folders/f0/ldyq8xbx0fvckg001kk64j7r0000gn/T/pip-j1ASQD-record/install-record.txt --single-version-externally-managed --compile failed with error code 1 in /private/var/folders/f0/ldyq8xbx0fvckg001kk64j7r0000gn/T/pip_build_~/pybluez
**easy_install Logs**
Reading http://pypi.python.org/simple/pybluez/
Best match: PyBluez 0.20
Downloading https://pypi.python.org/packages/source/P/PyBluez/PyBluez-0.20.zip#md5=79fad332df63b67a5f9a8d25042fb2a8
Processing PyBluez-0.20.zip
Running PyBluez-0.20/setup.py -q bdist_egg --dist-dir /tmp/easy_install-Y5Y9H1/PyBluez-0.20/egg-dist-tmp-kwjDlw
clang: warning: argument unused during compilation: '-mno-fused-madd'
**osx/_osxbt.c:676:5: error: unknown type name 'IOBluetoothDeviceInquiryRef'; did you mean
'IOBluetoothDeviceRef'?**
IOBluetoothDeviceInquiryRef inquiry;
^~~~~~~~~~~~~~~~~~~~~~~~~~~
IOBluetoothDeviceRef
**/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.9.sdk/System/Library/Frameworks/IOBluetooth.framework/Headers/IOBluetoothUserLib.h:34:47: note:**
'IOBluetoothDeviceRef' declared here
typedef struct OpaqueIOBluetoothObjectRef * IOBluetoothDeviceRef;
^
**osx/_osxbt.c:688:17: error: unknown type name 'IOBluetoothDeviceInquiryRef'; did you mean
'IOBluetoothDeviceRef'?**
IOBluetoothDeviceInquiryRef inquiryRef,
^~~~~~~~~~~~~~~~~~~~~~~~~~~
IOBluetoothDeviceRef
**/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.9.sdk/System/Library/Frameworks/IOBluetooth.framework/Headers/IOBluetoothUserLib.h:34:47: note:**
'IOBluetoothDeviceRef' declared here
typedef struct OpaqueIOBluetoothObjectRef * IOBluetoothDeviceRef;
^
**osx/_osxbt.c:703:19: warning: implicit declaration of function
'IOBluetoothDeviceInquiryCreateWithCallbackRefCon' is invalid in C99
[-Wimplicit-function-declaration]**
dd->inquiry = IOBluetoothDeviceInquiryCreateWithCallbackRefCon (&dd);
^
**osx/_osxbt.c:703:17: warning: incompatible integer to pointer conversion assigning to
'IOBluetoothDeviceRef' (aka 'struct OpaqueIOBluetoothObjectRef *') from 'int' [-Wint-conversion]**
dd->inquiry = IOBluetoothDeviceInquiryCreateWithCallbackRefCon (&dd);
^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
**osx/_osxbt.c:705:5: warning: implicit declaration of function
'IOBluetoothDeviceInquirySetCompleteCallback' is invalid in C99
[-Wimplicit-function-declaration]**
IOBluetoothDeviceInquirySetCompleteCallback (dd->inquiry,
^
**osx/_osxbt.c:717:5: warning: implicit declaration of function 'IOBluetoothDeviceInquiryStart' is
invalid in C99 [-Wimplicit-function-declaration]**
IOBluetoothDeviceInquiryStart (dd->inquiry);
^
**osx/_osxbt.c:721:5: warning: implicit declaration of function 'IOBluetoothDeviceInquiryDelete' is
invalid in C99 [-Wimplicit-function-declaration]**
IOBluetoothDeviceInquiryDelete (dd->inquiry);
^
5 warnings and 2 errors generated.
error: Setup script exited with error: command 'cc' failed with exit status 1
谁能在 Mavericks 上安装 pybluez ?
在 Mountain Lion 上也出现同样的安装错误。
编辑:
将 IOBluetoothDeviceInquiryRef 替换为 IOBluetoothDeviceRef 并消除了错误。并且由于警告而能够在 Mac 上安装。
使用 sudo python setup.py install
安装
这是输出
正在运行安装运行构建运行 build_py运行 build_ext运行安装库运行 install_egg_info删除/Library/Python/2.7/site-packages/PyBluez-0.20-py2.7.egg-info编写/Library/Python/2.7/site-packages/PyBluez-0.20-py2.7.egg-info
当我尝试导入蓝牙时出现异常
这是输出
>>> 导入蓝牙追溯(最近一次通话): 文件“”,第 1 行,位于 文件“bluetooth/__init__.py”,第 47 行,位于 从 osx 导入 * 文件“bluetooth/osx.py”,第 3 行,位于 提高 NotImplementedErrorNotImplementedError
提到错误的链接
python bluetooth discovery with pybluez
在Mac上安装pybluez应该做什么
最佳答案
PyBluez 仅适用于 PC。试试浅蓝色
下载并安装主发行版:https://github.com/postskolkovo/lightblue-0.4
cd ~/Downloads/lightblue-0.4-master
sudo python setup.py install
如果出现错误:
Check dependencies
No architectures to compile for (ARCHS=$(NATIVE_ARCH_ACTUAL), VALID_ARCHS=i386 x86_64).
** INSTALL FAILED **
您必须打开 setup.py 并更改:
os.system("xcodebuild install -arch '$(NATIVE_ARCH_ACTUAL)' -target LightAquaBlue -configuration Release DSTROOT=/ INSTALL_PATH=/Library/Frameworks DEPLOYMENT_LOCATION=YES")
到:
os.system("xcodebuild install -arch 'i386' -target LightAquaBlue -configuration Release DSTROOT=/ INSTALL_PATH=/Library/Frameworks DEPLOYMENT_LOCATION=YES")
关于python - Mac OS 上的 pybluez 安装错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/21695901/
我听说最好不要从您系统的 Perl 版本所在的 CPAN 安装模块。我知道如何使用命令行安装模块,我只是想知道是否有办法将 CPAN 与系统核心 Perl 分开。 我应该: 下载源代码并专门为这些模块
我听说最好不要从系统的 Perl 版本所在的 CPAN 安装模块。我知道如何使用命令行安装模块,我只是想知道是否有办法将 CPAN 与系统的核心 Perl 分开。 我应该: 下载源代码并专门为这些模块
单独安装 electron 与通过 electron-builder 安装有什么区别?我正在使用 React 构建一个 Electron 应用程序,并且已经找到了一些教程。它们安装 Electron
两者安装有什么区别?我按照安装页面上的说明在全局范围内安装了 webpack,然后我转到了入门指南,据说在那里可以在本地安装 webpack-cli。 CLI = Command Line Inter
我在 OS X Yosemite 上用 PHP 安装了默认的 Apache 服务器,安装了 pear,用 brew 安装了 Solr (brew install solr),现在我正在尝试使用 PEC
我解压并编译了 Ruby 2.1 并安装了几个支持工具。 但是当我安装了 libssl-dev 时,OpenSSL 不会安装。 我在支持 openssl 时遇到这个错误: make: *** No r
我在 android studio 2.3.1 和 gradle 3.2 中设计了 2 到 3 个应用程序。当我从它运行应用程序到任何设备或模拟器时,一切都工作正常。但是当我从构建文件夹中获取该 ap
我注意到我正在读一本书提到通过 apt-get 安装 numpy 和 opencv apt-get install python-numpy python-opencv 但我可以通过以下方式在 pip
我正在尝试在 Windows 8.1 上安装 ansicon。我提取了文件并达到了我需要调用 ansicon -i 的级别。当我在 cmd 中输入此内容并运行 python 脚本时效果很好,但是当我通
我有 linux MINT 17.3 Kernel 4.4.0-81 所有更新可用。 (由于不同的原因,我无法迁移到更新版本的 ubuntu/mint) 我已经通过 PPA 安装了 FFMPEG(不是
尝试在本地运行我的应用程序时出现错误: 我只在 chrome 浏览器中收到此错误。我尝试过不同的东西,但我不确定为什么它是 Chrome 特定的。 最佳答案 我怀疑这不是 Firebase 问题,而是
这是我第一次开发 AngularJS 应用程序并使用脚手架工具 Yeoman ( http://yeoman.io/ )。我想对我的一些图标使用 fontawesome ( http://fortaw
我知道您通常“应该”$ pip install 如果包没有 brew ,但如果有一个你想安装的 python 包,你可以使用 $ pip install或 $ brew install为了?例如,通过
我正在尝试通过 RVM 安装 Ruby 1.9.3。然而,当谈到安装 RubyGems 时,我得到了这个: curl: (22) The requested URL returned error: 4
我是真正提出问题的新手,但你去吧。 我一直在尝试按照安装指南添加 dnsname: https://github.com/containers/dnsname https://github.com/c
Studio更新至0.4.0 建筑产量为“需要1.8版Gradle”;将设置设置为1.8 bin目录; 建立 “要求1.9级”;将设置设置为1.9 bin; 建立 “要求1.8级” 啊。不知道该怎么做
我刚刚注意到 kernel.org 因维护而停机。是否有使用不同镜子的不同公式?或者我可以向 Homebrew 软件添加不同的来源(如 bundler ?)? 谢谢你的帮助! 最佳答案 快速解决方法:
当我运行时: peardev install phpunit/PHPUnit 我得到以下信息: No releases available for package "pear.phpunit.de/P
服务器操作系统为Fedora 24. 64bit。 我想安装 Git 2.6.6。 所以下载源码并安装。 此服务器离线。所以我不使用“yum”。 ./configure --prefix=/usr/l
我正在尝试在我自己的服务器(操作系统:Linux Ubuntu Server 12.04)上安装 OpenEdX,但我遇到了同样的错误。谁能帮帮我? TASK: [ insights | insta
我是一名优秀的程序员,十分优秀!