无法使用 pip 安装包

无法使用 pip 安装包

我正在尝试在虚拟环境中使用 pip 安装一个包:

pip install fuse-python

但输出是

Downloading/unpacking fuse-python
  Downloading fuse-python-0.2.tar.gz (53kB): 53kB downloaded
  Running setup.py (path:/home/nicu/dev/bacula/ve/build/fuse-python/setup.py) egg_info for package fuse-python
    Usage: pkg-config [-?] [--version] [--modversion]
            [--atleast-pkgconfig-version=VERSION] [--libs] [--static]
            [--short-errors] [--libs-only-l] [--libs-only-other] [--libs-only-L]
            [--cflags] [--cflags-only-I] [--cflags-only-other] [--variable=NAME]
            [--define-variable=NAME=VALUE] [--exists] [--print-variables]
            [--uninstalled] [--atleast-version=VERSION] [--exact-version=VERSION]
            [--max-version=VERSION] [--list-all] [--debug] [--print-errors]
            [--silence-errors] [--errors-to-stdout] [--print-provides]
            [--print-requires] [--print-requires-private] [-?|--help] [--usage]
    pkg-config could not find fuse:
    you might need to adjust PKG_CONFIG_PATH or your
    FUSE installation is very old (older than 2.1-pre1)
    Traceback (most recent call last):
      File "<string>", line 17, in <module>
      File "/home/nicu/dev/bacula/ve/build/fuse-python/setup.py", line 69, in <module>
        iflags = [x[2:] for x in cflags.split() if x[0:2] == '-I']
    NameError: name 'cflags' is not defined
    Complete output from command python setup.py egg_info:
    Usage: pkg-config [-?] [--version] [--modversion]

        [--atleast-pkgconfig-version=VERSION] [--libs] [--static]

        [--short-errors] [--libs-only-l] [--libs-only-other] [--libs-only-L]

        [--cflags] [--cflags-only-I] [--cflags-only-other] [--variable=NAME]

        [--define-variable=NAME=VALUE] [--exists] [--print-variables]

        [--uninstalled] [--atleast-version=VERSION] [--exact-version=VERSION]

        [--max-version=VERSION] [--list-all] [--debug] [--print-errors]

        [--silence-errors] [--errors-to-stdout] [--print-provides]

        [--print-requires] [--print-requires-private] [-?|--help] [--usage]

pkg-config could not find fuse:

you might need to adjust PKG_CONFIG_PATH or your

FUSE installation is very old (older than 2.1-pre1)

Traceback (most recent call last):

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

  File "/home/nicu/dev/bacula/ve/build/fuse-python/setup.py", line 69, in <module>

    iflags = [x[2:] for x in cflags.split() if x[0:2] == '-I']

NameError: name 'cflags' is not defined

----------------------------------------
Cleaning up...
Command python setup.py egg_info failed with error code 1 in /home/nicu/dev/bacula/ve/build/fuse-python
Storing debug log for failure in /home/nicu/.pip/pip.log

据我所知,pkg-config 和 PKG_CONFIG_PATH 有问题

我正在运行 ubuntu 14.04,并且输出dpkg -l | grep is(所以我的 fuse 安装不是‘太旧’):

ii  fuse                                        2.9.2-4ubuntu4                                      amd64        Filesystem in Userspace
ii  gvfs-fuse                                   1.20.1-1ubuntu1                                     amd64        userspace virtual filesystem - fuse server
ii  ifuse                                       1.1.2-0.1                                           amd64        FUSE module for iPhone and iPod Touch devices
ii  libfuse2:amd64                              2.9.2-4ubuntu4                                      amd64        Filesystem in Userspace (library)

更新:我使用 sudo apt-get install python-fuse 安装了它,但它是全局安装的:

ii  python-fuse       2:0.2.1-9   amd64    Python bindings for FUSE (Filesystems in USErland)

答案1

安装sudo apt-get install libfuse-dev并重试。成功了。

相关内容