4

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

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
4

2 回答 2

1

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

于 2015-09-07T23:53:06.520 回答
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。还没有解决方案。

于 2016-08-02T09:42:08.440 回答