【问题标题】:Problems installing cryptography安装密码学的问题
【发布时间】:2016-01-01 08:23:30
【问题描述】:

所以当我尝试通过安装密码学时

python -m pip install cryptography

我收到两条错误消息:

  1. 密码学构建轮子失败
  2. command "/usr/local/bin/python -c "import setuptools, tokenize;file='/private/var/folders/qf/57zhxjfn4hl95y8xg7l12xpm0000gn/T/pip-build-DBR7_Y/ cryptography/setup.py';exec(compile(getattr(tokenize, 'open', open)(file).read().replace('\r\n', '\n') , file, 'exec'))" install --record /var/folders/qf/57zhxjfn4hl95y8xg7l12xpm0000gn/T/pip-msQ3gT-record/install-record.txt --single-version-externally- managed --compile" 失败,错误代码 1 在 /private/var/folders/qf/57zhxjfn4hl95y8xg7l12xpm0000gn/T/pip-build-DBR7_Y/cryptography

关于如何解决这个问题的任何想法?

【问题讨论】:

  • 你运行的是什么操作系统?
  • 执行/usr/local/bin/python -c "import setuptools, tokenize;file='/private/var/folders/qf/57zhxjfn4hl95y8xg7l12xpm0000gn/T/pip-build-DBR7_Y/cryptography/setup.py';exec(compile(getattr(tokenize, 'open', open)(file).read().replace('\r\n', '\n'), file, 'exec'))" install --record /var/folders/qf/57zhxjfn4hl95y8xg7l12xpm0000gn/T/pip-msQ3gT-record/install-record.txt --single-version-externally-managed --compile(失败的命令)并显示输出。

标签: python cryptography installation


【解决方案1】:

就像在您的其他帖子中一样 Trouble with running pip install

使用 sudo 运行相同的命令

【讨论】:

    【解决方案2】:

    可能是它的依赖项挂在你的网络上,你可以先安装它们 就我而言,它取决于 idna、enum34、ipaddress、pycparser,所以

     pip install idna enum34 ipaddress pycparser
    

    然后安装密码学

    `pip install cryptography`
    

    如何知道密码学的依赖? 密码学的依赖依赖于系统环境,当它挂起时,你可以找到这样的日志,第一行是它的依赖。

    Installing collected packages: cryptography, idna, enum34, ipaddress, pycparser
    Running setup.py install for cryptography
    warning: no previously-included files matching 'yacctab.*' found under directory 'tests'
    warning: no previously-included files matching 'lextab.*' found under directory 'tests'
    warning: no previously-included files matching 'yacctab.*' found under directory 'examples'
    warning: no previously-included files matching 'lextab.*' found under directory 'examples'
    zip_safe flag not set; analyzing archive contents...
    

    【讨论】:

      【解决方案3】:

      就我而言,我运行的是旧版本的 pip,收到以下错误消息:

      You are using pip version 7.1.0, however version 8.1.1 is available.
      

      您应该考虑通过“pip install --upgrade pip”命令进行升级。

      我只是更新到最新版本,安装没有问题:

      pip install --upgrade pip
      

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 2022-11-11
        • 1970-01-01
        • 2014-11-12
        • 2017-12-18
        • 1970-01-01
        • 2016-05-10
        • 2022-07-05
        相关资源
        最近更新 更多