我尝试使用PyBluez在树莓派上运行蓝牙低功耗示例。
所有的例子都需要gattlib模块。
from gattlib import *
ImportError: No module named gattlib
我试着安装它:
pip3 install gattlib
但这不起作用?我不能安装gattlib?
编辑:这是安装gattlib时的输出:
pi@raspberrypi:~ $ pip3 install gattlib
Collecting gattlib
Using cached https://files.pythonhosted.org/packages/be/2f/5b1aecec551b42b59d8b399ad444b5672972efb590ca83d784dbe616a3e1/gattlib-0.20150805.tar.gz
Complete output from command python setup.py egg_info:
Package glib-2.0 was not found in the pkg-config search path.
Perhaps you should add the directory containing `glib-2.0.pc'
to the PKG_CONFIG_PATH environment variable
No package 'glib-2.0' found
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/tmp/pip-build-p365j80d/gattlib/setup.py", line 12, in <module>
"pkg-config --cflags glib-2.0".split()).decode('utf-8')
File "/usr/lib/python3.5/subprocess.py", line 316, in check_output
**kwargs).stdout
File "/usr/lib/python3.5/subprocess.py", line 398, in run
output=stdout, stderr=stderr)
subprocess.CalledProcessError: Command '['pkg-config', '--cflags', 'glib-2.0']' returned non-zero exit status 1
----------------------------------------
Command "python setup.py egg_info" failed with error code 1 in /tmp/pip-build-p365j80d/gattlib/
3条答案
按热度按时间mcdcgff01#
文件:https://pypi.org/project/gattlib/
首先安装这些依赖项:
然后,对于python3的
gattlib
,尝试一下:3pvhb19x2#
在linux中解决这个问题的方法是
qnzebej03#
我也有这个。我认为它似乎缺乏一些依赖关系:
https://bitbucket.org/OscarAcena/pygattlib/src/a858e8626a93cb9b4ad56f3fb980a6517a0702c6/DEPENDS?at=default&fileviewer=file-view-default
对我来说,即使安装后,我无法成功安装。我使用了一个替代包: