如何在Raspberry pi上安装python-gammu

时间:2015-08-19 13:48:54

标签: python raspberry-pi gammu

我在安装gammu的python模块时遇到问题 树莓派模型b +。我怎么解决这个问题 ?谢谢!

pi@raspberrypi ~ $ 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

2 个答案:

答案 0 :(得分:1)

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

答案 1 :(得分:1)

我有完全相同的问题,甚至更新到最新版本的Raspbian(2016-05-27-raspbian-jessie)并没有解决它(正如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丢失了。尚无解决方案。