首页
学习
活动
专区
工具
TVP
发布
社区首页 >问答首页 >由于libffi,无法在raspberry pi上安装加密

由于libffi,无法在raspberry pi上安装加密
EN

Stack Overflow用户
提问于 2018-05-29 05:46:55
回答 1查看 2.4K关注 0票数 2

我一直在尝试在我的Raspberry Pi Zero上安装"flask-ask“包。然而,当尝试安装依赖“加密”时,有一个问题:

代码语言:javascript
复制
Downloading/unpacking cryptography
  Downloading cryptography-2.2.2.tar.gz (443kB): 443kB downloaded
  Running setup.py (path:/tmp/pip-build-wg353po4/cryptography/setup.py) egg_info for package cryptography
    Traceback (most recent call last):
      File "<string>", line 17, in <module>
      File "/tmp/pip-build-wg353po4/cryptography/setup.py", line 28, in <module>
        "cryptography requires setuptools 18.5 or newer, please upgrade to a "
    RuntimeError: cryptography requires setuptools 18.5 or newer, please upgrade to a newer version of setuptools
    Complete output from command python setup.py egg_info:
    Traceback (most recent call last):

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

  File "/tmp/pip-build-wg353po4/cryptography/setup.py", line 28, in <module>

    "cryptography requires setuptools 18.5 or newer, please upgrade to a "

RuntimeError: cryptography requires setuptools 18.5 or newer, please upgrade to a newer version of setuptools

----------------------------------------
Cleaning up...
Command python setup.py egg_info failed with error code 1 in /tmp/pip-build-wg353po4/cryptography
Storing debug log for failure in /home/pi/.pip/pip.log

(这些日志是在尝试自行安装密码术时获得的,但在安装flask-ask时也会出现相同的错误)

我尝试过pip3 install -U setuptools来升级它,但这不起作用:

代码语言:javascript
复制
pi@raspberrypi:~ $ pip3 install -U setuptools
Downloading/unpacking setuptools from https://files.pythonhosted.org/packages/7f/e1/820d941153923aac1d49d7fc37e17b6e73bfbd2904959fffbad77900cf92/setuptools-39.2.0-py2.py3-none-any.whl#sha256=8fca9275c89964f13da985c3656cb00ba029d7f3916b37990927ffdf264e7926
  Downloading setuptools-39.2.0-py2.py3-none-any.whl (567kB): 567kB downloaded
Installing collected packages: setuptools
  Found existing installation: setuptools 5.5.1
    Not uninstalling setuptools at /usr/lib/python3/dist-packages, owned by OS
  Can't roll back setuptools; was not uninstalled
Cleaning up...
Exception:
Traceback (most recent call last):
  File "/usr/lib/python3/dist-packages/pip/basecommand.py", line 122, in main
    status = self.run(options, args)
  File "/usr/lib/python3/dist-packages/pip/commands/install.py", line 295, in run
    requirement_set.install(install_options, global_options, root=options.root_path)
  File "/usr/lib/python3/dist-packages/pip/req.py", line 1436, in install
    requirement.install(install_options, global_options, *args, **kwargs)
  File "/usr/lib/python3/dist-packages/pip/req.py", line 672, in install
    self.move_wheel_files(self.source_dir, root=root)
  File "/usr/lib/python3/dist-packages/pip/req.py", line 902, in move_wheel_files
    pycompile=self.pycompile,
  File "/usr/lib/python3/dist-packages/pip/wheel.py", line 214, in move_wheel_files
    clobber(source, lib_dir, True)
  File "/usr/lib/python3/dist-packages/pip/wheel.py", line 208, in clobber
    shutil.copy2(srcfile, destfile)
  File "/usr/lib/python3.4/shutil.py", line 244, in copy2
    copyfile(src, dst, follow_symlinks=follow_symlinks)
  File "/usr/lib/python3.4/shutil.py", line 108, in copyfile
    with open(dst, 'wb') as fdst:
PermissionError: [Errno 13] Permission denied: '/usr/local/lib/python3.4/dist-packages/easy_install.py'

Storing debug log for failure in /home/pi/.pip/pip.log

那么我该怎么做呢?我在谷歌上搜索了很多不同的东西,我看到其他人在Pi上遇到了密码学问题,但不是这个具体的问题。

编辑:好的,现在我已经完成了pip install --user -U setuptools,它工作得很好。现在我得到了一个完全不同的错误:

代码语言:javascript
复制
    running install_egg_info
    running egg_info
    creating lib/PyYAML.egg-info
    writing lib/PyYAML.egg-info/PKG-INFO
    writing top-level names to lib/PyYAML.egg-info/top_level.txt
    writing dependency_links to lib/PyYAML.egg-info/dependency_links.txt
    writing manifest file 'lib/PyYAML.egg-info/SOURCES.txt'
    reading manifest file 'lib/PyYAML.egg-info/SOURCES.txt'
    writing manifest file 'lib/PyYAML.egg-info/SOURCES.txt'
    Copying lib/PyYAML.egg-info to /home/pi/.local/lib/python2.7/site-packages/PyYAML-3.12$
    running install_scripts
    writing list of installed files to '/tmp/pip-XYXo6X-record/install-record.txt'
  Could not find .egg-info directory in install record for PyYAML==3.12 (from flask-ask)
  Running setup.py install for cryptography
    Running command /usr/bin/python -c "import setuptools, tokenize;__file__='/tmp/pip-bui$
    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:2:20: fatal error: Python.h: No such file or directory
     #include <Python.h>
                        ^
    compilation terminated.
    Traceback (most recent call last):
      File "<string>", line 1, in <module>
      File "/tmp/pip-build-2gl72v/cryptography/setup.py", line 319, in <module>
        **keywords_with_side_effects(sys.argv)
      File "/home/pi/.local/lib/python2.7/site-packages/setuptools/__init__.py", line 128,$
        _install_setup_requires(attrs)
      File "/home/pi/.local/lib/python2.7/site-packages/setuptools/__init__.py", line 123,$
        dist.fetch_build_eggs(dist.setup_requires)
      File "/home/pi/.local/lib/python2.7/site-packages/setuptools/dist.py", line 514, in $
        replace_conflicting=True,
      File "/home/pi/.local/lib/python2.7/site-packages/pkg_resources/__init__.py", line 7$
        replace_conflicting=replace_conflicting
      File "/home/pi/.local/lib/python2.7/site-packages/pkg_resources/__init__.py", line 1$
        return self.obtain(req, installer)
      File "/home/pi/.local/lib/python2.7/site-packages/pkg_resources/__init__.py", line 1$
        return installer(requirement)
      File "/home/pi/.local/lib/python2.7/site-packages/setuptools/dist.py", line 581, in $
        return cmd.easy_install(req)
      File "/home/pi/.local/lib/python2.7/site-packages/setuptools/command/easy_install.py$
        return self.install_item(spec, dist.location, tmpdir, deps)
      File "/home/pi/.local/lib/python2.7/site-packages/setuptools/command/easy_install.py$
        dists = self.install_eggs(spec, download, tmpdir)
      File "/home/pi/.local/lib/python2.7/site-packages/setuptools/command/easy_install.py$
        return self.build_and_install(setup_script, setup_base)
      File "/home/pi/.local/lib/python2.7/site-packages/setuptools/command/easy_install.py$
        self.run_setup(setup_script, setup_base, args)
      File "/home/pi/.local/lib/python2.7/site-packages/setuptools/command/easy_install.py$
        raise DistutilsError("Setup script exited with %s" % (v.args[0],))
    distutils.errors.DistutilsError: Setup script exited with error: command 'arm-linux-gn$

    Complete output from command /usr/bin/python -c "import setuptools, tokenize;__file__=$
    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:2:20: fatal error: Python.h: No such file or directory

 #include <Python.h>

                    ^

compilation terminated.

Traceback (most recent call last):

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

  File "/tmp/pip-build-2gl72v/cryptography/setup.py", line 319, in <module>

    **keywords_with_side_effects(sys.argv)

  File "/home/pi/.local/lib/python2.7/site-packages/setuptools/__init__.py", line 128, in $

    _install_setup_requires(attrs)

  File "/home/pi/.local/lib/python2.7/site-packages/setuptools/__init__.py", line 123, in $

    dist.fetch_build_eggs(dist.setup_requires)

  File "/home/pi/.local/lib/python2.7/site-packages/setuptools/dist.py", line 514, in fetc$

    replace_conflicting=True,

  File "/home/pi/.local/lib/python2.7/site-packages/pkg_resources/__init__.py", line 770, $

    replace_conflicting=replace_conflicting

  File "/home/pi/.local/lib/python2.7/site-packages/pkg_resources/__init__.py", line 1053,$

    return self.obtain(req, installer)

  File "/home/pi/.local/lib/python2.7/site-packages/pkg_resources/__init__.py", line 1065,$

    return installer(requirement)

  File "/home/pi/.local/lib/python2.7/site-packages/setuptools/dist.py", line 581, in fetc$

    return cmd.easy_install(req)

  File "/home/pi/.local/lib/python2.7/site-packages/setuptools/command/easy_install.py", l$

    return self.install_item(spec, dist.location, tmpdir, deps)

  File "/home/pi/.local/lib/python2.7/site-packages/setuptools/command/easy_install.py", l$

    dists = self.install_eggs(spec, download, tmpdir)

  File "/home/pi/.local/lib/python2.7/site-packages/setuptools/command/easy_install.py", l$

    return self.build_and_install(setup_script, setup_base)

  File "/home/pi/.local/lib/python2.7/site-packages/setuptools/command/easy_install.py", l$

    self.run_setup(setup_script, setup_base, args)

  File "/home/pi/.local/lib/python2.7/site-packages/setuptools/command/easy_install.py", l$

    raise DistutilsError("Setup script exited with %s" % (v.args[0],))

distutils.errors.DistutilsError: Setup script exited with error: command 'arm-linux-gnueab$

----------------------------------------
Cleaning up...
Command /usr/bin/python -c "import setuptools, tokenize;__file__='/tmp/pip-build-2gl72v/cr$
Exception information:
Traceback (most recent call last):
  File "/usr/lib/python2.7/dist-packages/pip/basecommand.py", line 122, in main
    status = self.run(options, args)
  File "/usr/lib/python2.7/dist-packages/pip/commands/install.py", line 295, in run
    requirement_set.install(install_options, global_options, root=options.root_path)
  File "/usr/lib/python2.7/dist-packages/pip/req.py", line 1436, in install
    requirement.install(install_options, global_options, *args, **kwargs)
  File "/usr/lib/python2.7/dist-packages/pip/req.py", line 707, in install
    cwd=self.source_dir, filter_stdout=self._filter_install, show_stdout=False)
  File "/usr/lib/python2.7/dist-packages/pip/util.py", line 716, in call_subprocess
    % (command_desc, proc.returncode, cwd))
InstallationError: Command /usr/bin/python -c "import setuptools, tokenize;__file__='/tmp/$

我不知道为什么在这一点上会发生这种情况。

EN

回答 1

Stack Overflow用户

发布于 2018-05-29 07:06:16

我最近幸运地遇到了类似的情况,我首先更新了pip。

代码语言:javascript
复制
sudo apt-get install -y python3-pip
sudo pip3 -H pip3 install --upgrade pip
票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/50573741

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档