Не удается установить пакет pysftp, пакет 'libffi' не найден, ошибка с кодом ошибки 1 - PullRequest
0 голосов
/ 22 мая 2018

Я установил чистую распиановую растяжку на пи ноль и пытаюсь установить pysftp

pip install pysftp

выдает следующую ошибку:

Collecting pysftp
  Using cached https://files.pythonhosted.org/packages/36/60/45f30390a38b1f92e0a8cf4de178cd7c2bc3f874c85430e40ccf99df8fe7/pysftp-0.2.9.tar.gz
Collecting paramiko>=1.17 (from pysftp)
  Using cached https://files.pythonhosted.org/packages/3e/db/cb7b6656e0e7387637ce850689084dc0b94b44df31cc52e5fc5c2c4fd2c1/paramiko-2.4.1-py2.py3-none-any.whl
Collecting pynacl>=1.0.1 (from paramiko>=1.17->pysftp)
  Using cached https://files.pythonhosted.org/packages/08/19/cf56e60efd122fa6d2228118a9b345455b13ffe16a14be81d025b03b261f/PyNaCl-1.2.1.tar.gz
    Complete output from command python setup.py egg_info:
    Package libffi was not found in the pkg-config search path.
    Perhaps you should add the directory containing `libffi.pc'
    to the PKG_CONFIG_PATH environment variable
    No package 'libffi' found
    Package libffi was not found in the pkg-config search path.
    Perhaps you should add the directory containing `libffi.pc'
    to the PKG_CONFIG_PATH environment variable
    No package 'libffi' found
    Package libffi was not found in the pkg-config search path.
    Perhaps you should add the directory containing `libffi.pc'
    to the PKG_CONFIG_PATH environment variable
    No package 'libffi' found
    Package libffi was not found in the pkg-config search path.
    Perhaps you should add the directory containing `libffi.pc'
    to the PKG_CONFIG_PATH environment variable
    No package 'libffi' found
    Package libffi was not found in the pkg-config search path.
    Perhaps you should add the directory containing `libffi.pc'
    to the PKG_CONFIG_PATH environment variable
    No package 'libffi' found
    c/_cffi_backend.c:15:17: fatal error: ffi.h: No such file or directory
     #include <ffi.h>
                     ^
    compilation terminated.
    Traceback (most recent call last):
      File "<string>", line 1, in <module>
      File "/tmp/pip-build-63NrlL/pynacl/setup.py", line 251, in <module>
        "Programming Language :: Python :: 3.6",
      File "/home/pi/.local/lib/python2.7/site-packages/setuptools/__init__.py", line 128, in setup
        _install_setup_requires(attrs)
      File "/home/pi/.local/lib/python2.7/site-packages/setuptools/__init__.py", line 123, in _install_setup_requires
        dist.fetch_build_eggs(dist.setup_requires)
      File "/home/pi/.local/lib/python2.7/site-packages/setuptools/dist.py", line 514, in fetch_build_eggs
        replace_conflicting=True,
      File "/home/pi/.local/lib/python2.7/site-packages/pkg_resources/__init__.py", line 770, in resolve
        replace_conflicting=replace_conflicting
      File "/home/pi/.local/lib/python2.7/site-packages/pkg_resources/__init__.py", line 1053, in best_match
        return self.obtain(req, installer)
      File "/home/pi/.local/lib/python2.7/site-packages/pkg_resources/__init__.py", line 1065, in obtain
        return installer(requirement)
      File "/home/pi/.local/lib/python2.7/site-packages/setuptools/dist.py", line 581, in fetch_build_egg
        return cmd.easy_install(req)
      File "/home/pi/.local/lib/python2.7/site-packages/setuptools/command/easy_install.py", line 673, in easy_install
        return self.install_item(spec, dist.location, tmpdir, deps)
      File "/home/pi/.local/lib/python2.7/site-packages/setuptools/command/easy_install.py", line 699, in install_item
        dists = self.install_eggs(spec, download, tmpdir)
      File "/home/pi/.local/lib/python2.7/site-packages/setuptools/command/easy_install.py", line 884, in install_eggs
        return self.build_and_install(setup_script, setup_base)
      File "/home/pi/.local/lib/python2.7/site-packages/setuptools/command/easy_install.py", line 1152, in build_and_install
        self.run_setup(setup_script, setup_base, args)
      File "/home/pi/.local/lib/python2.7/site-packages/setuptools/command/easy_install.py", line 1140, in run_setup
        raise DistutilsError("Setup script exited with %s" % (v.args[0],))
    distutils.errors.DistutilsError: Setup script exited with error: command 'arm-linux-gnueabihf-gcc' failed with exit status 1

    ----------------------------------------
Command "python setup.py egg_info" failed with error code 1 in /tmp/pip-build-63NrlL/pynacl/

Я пытался обновитьsetuptools и установить ez_setup

pip install --upgrade setuptools
pip install ez_setup

Это ничего не изменило, также попытался установить отсутствующий пакет с помощью

pip install libffi
pip install cffi

Но все это не удалось.Я перепробовал все, что нашел в интернете, но ничего не работает.Потраченные впустую часы на это ... Какого черта я пропускаю?

РЕДАКТИРОВАТЬ: Также пытался:

pip install libffi-dev

Но это приводит к:

Could not find a version that satisfies the requirement libffi-dev (from versions: )
No matching distribution found for libffi-dev

Пробовал:

sudo apt-get libffi-dev

но это приводит к:

Package libffi-dev is not available, but is referred to by another package.
This may mean that the package is missing, has been obsoleted, or
is only available from another source

E: Package 'libffi-dev' has no installation candidate
...