2015-08-19 129 views
3

安装python-监务我在 树莓派模型B +安装Python模块用于监务时有问题。我怎么解决这个问题 ?谢谢!如何在树莓派

[email protected] ~ $ sudo pip install python-gammu 
Downloading/unpacking python-gammu 
    Running setup.py egg_info for package python-gammu 
    Package gammu was not found in the pkg-config search path. 
    Perhaps you should add the directory containing `gammu.pc' 
    to the PKG_CONFIG_PATH environment variable 
    No package 'gammu' found 
    Traceback (most recent call last): 
     File "<string>", line 14, in <module> 
     File "/home/pi/build/python-gammu/setup.py", line 108, in <module> 
     check_minimum_gammu_version() 
     File "/home/pi/build/python-gammu/setup.py", line 43, in check_minimum_gammu_version 
     "gammu" 
     File "/usr/lib/python2.7/distutils/spawn.py", line 34, in spawn 
     _spawn_posix(cmd, search_path, dry_run=dry_run) 
     File "/usr/lib/python2.7/distutils/spawn.py", line 167, in _spawn_posix 
     (cmd[0], exit_status) 
    distutils.errors.DistutilsExecError: command 'pkg-config' failed with exit status 1 
    Complete output from command python setup.py egg_info: 
    Package gammu was not found in the pkg-config search path. 

Perhaps you should add the directory containing `gammu.pc' 

to the PKG_CONFIG_PATH environment variable 

No package 'gammu' found 

Traceback (most recent call last): 

    File "<string>", line 14, in <module> 

    File "/home/pi/build/python-gammu/setup.py", line 108, in <module> 

    check_minimum_gammu_version() 

    File "/home/pi/build/python-gammu/setup.py", line 43, in check_minimum_gammu_version 

    "gammu" 

    File "/usr/lib/python2.7/distutils/spawn.py", line 34, in spawn 

    _spawn_posix(cmd, search_path, dry_run=dry_run) 

    File "/usr/lib/python2.7/distutils/spawn.py", line 167, in _spawn_posix 

    (cmd[0], exit_status) 

distutils.errors.DistutilsExecError: command 'pkg-config' failed with exit status 1 

---------------------------------------- 
Command python setup.py egg_info failed with error code 1 in /home/pi/build/python-gammu 
Storing complete log in /root/.pip/pip.log 
+0

是否安装了监务库和可能它的开发包? – deets

+0

是的,这些都已安装。 – drled

+0

那么,是什么'的dpkg -L监务-dev'(或任何包装的称呼)的产量,并包含头文件和gammu.pc或任何其他* .PC文件? – deets

回答

1

我能够通过安装rasbian的完整新版本来解决这个问题。

1

我有完全一样的问题的探析,甚至更新到最新版本的Raspbian(2016年5月27日 - raspbian - 杰西)并没有解决这个问题(由OP的建议)。

在新系统中,我跑

sudo apt-get update 
sudo apt-get install gammu 
sudo gammu-config 
pip install python-gammu 

和再失败,出现相同的错误消息的OP已经发布。

然而,要走的路似乎运行

sudo apt-get install python-gammu 

代替。这将python-gammu安装到python2中 - 在python3 gammu中缺少。没有解决方案呢。