virtualenv 上的 pip install requests[security] 无法构建密码学和 cffi 轮子

2024-03-25

跟随时this http://docs.python-guide.org/en/latest/dev/virtualenvs/ and this https://www.jeffknupp.com/blog/2012/02/09/starting-a-django-project-the-right-way/在虚拟环境中使用 django 我注意到使用 pip 时会出现 InsecurePlatformWarning。搜索将我带到了这篇SO帖子[我无法链接],但后来我得到了这个:

(doconenv){me}@{hostname} /media/{me}/{route} $ pip install cryptography
Collecting cryptography
/media/{me}/{route}/doconenv/local/lib/python2.7/site-packages/pip/_vendor/requests/packages/urllib3/util/ssl_.py:90: InsecurePlatformWarning: A true SSLContext object is not available. This prevents urllib3 from configuring SSL appropriately and may cause certain SSL connections to fail. For more information, see https://urllib3.readthedocs.org/en/latest/security.html#insecureplatformwarning.
  InsecurePlatformWarning
  Using cached cryptography-1.0.1.tar.gz
Requirement already satisfied (use --upgrade to upgrade): idna>=2.0 in ./doconenv/lib/python2.7/site-packages (from cryptography)
Requirement already satisfied (use --upgrade to upgrade): pyasn1>=0.1.8 in ./doconenv/lib/python2.7/site-packages (from cryptography)
Requirement already satisfied (use --upgrade to upgrade): six>=1.4.1 in ./doconenv/lib/python2.7/site-packages (from cryptography)
Requirement already satisfied (use --upgrade to upgrade): setuptools in ./doconenv/lib/python2.7/site-packages (from cryptography)
Requirement already satisfied (use --upgrade to upgrade): enum34 in ./doconenv/lib/python2.7/site-packages (from cryptography)
Requirement already satisfied (use --upgrade to upgrade): ipaddress in ./doconenv/lib/python2.7/site-packages (from cryptography)
Collecting cffi>=1.1.0 (from cryptography)
  Using cached cffi-1.2.1.tar.gz
Requirement already satisfied (use --upgrade to upgrade): pycparser in ./doconenv/lib/python2.7/site-packages (from cffi>=1.1.0->cryptography)
Building wheels for collected packages: cryptography, cffi
  Running setup.py bdist_wheel for cryptography
  Complete output from command /media/{me}/{route}/doconenv/bin/python -c "import setuptools;__file__='/tmp/pip-build-SsTBPB/cryptography/setup.py';exec(compile(open(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" bdist_wheel -d /tmp/tmpaZKxJjpip-wheel-:
  c/_cffi_backend.c:2:20: fatal error: Python.h: No existe el archivo o el directorio
   #include <Python.h>
                      ^
  compilation terminated.
  Traceback (most recent call last):
    File "<string>", line 1, in <module>
    File "/tmp/pip-build-SsTBPB/cryptography/setup.py", line 313, in <module>
      **keywords_with_side_effects(sys.argv)
    File "/usr/lib/python2.7/distutils/core.py", line 111, in setup
      _setup_distribution = dist = klass(attrs)
    File "/media/{me}/{route}/doconenv/local/lib/python2.7/site-packages/setuptools/dist.py", line 268, in __init__
      self.fetch_build_eggs(attrs['setup_requires'])
    File "/media/{me}/{route}/doconenv/local/lib/python2.7/site-packages/setuptools/dist.py", line 313, in fetch_build_eggs
      replace_conflicting=True,
    File "/media/{me}/{route}/doconenv/local/lib/python2.7/site-packages/pkg_resources/__init__.py", line 836, in resolve
      dist = best[req.key] = env.best_match(req, ws, installer)
    File "/media/{me}/{route}/doconenv/local/lib/python2.7/site-packages/pkg_resources/__init__.py", line 1081, in best_match
      return self.obtain(req, installer)
    File "/media/{me}/{route}/doconenv/local/lib/python2.7/site-packages/pkg_resources/__init__.py", line 1093, in obtain
      return installer(requirement)
    File "/media/{me}/{route}/doconenv/local/lib/python2.7/site-packages/setuptools/dist.py", line 380, in fetch_build_egg
      return cmd.easy_install(req)
    File "/media/{me}/{route}/doconenv/local/lib/python2.7/site-packages/setuptools/command/easy_install.py", line 629, in easy_install
      return self.install_item(spec, dist.location, tmpdir, deps)
    File "/media/{me}/{route}/doconenv/local/lib/python2.7/site-packages/setuptools/command/easy_install.py", line 659, in install_item
      dists = self.install_eggs(spec, download, tmpdir)
    File "/media/{me}/{route}/doconenv/local/lib/python2.7/site-packages/setuptools/command/easy_install.py", line 842, in install_eggs
      return self.build_and_install(setup_script, setup_base)
    File "/media/{me}/{route}/doconenv/local/lib/python2.7/site-packages/setuptools/command/easy_install.py", line 1070, in build_and_install
      self.run_setup(setup_script, setup_base, args)
    File "/media/{me}/{route}/doconenv/local/lib/python2.7/site-packages/setuptools/command/easy_install.py", line 1058, in run_setup
      raise DistutilsError("Setup script exited with %s" % (v.args[0],))
  distutils.errors.DistutilsError: Setup script exited with error: command 'x86_64-linux-gnu-gcc' failed with exit status 1

  ----------------------------------------
  Failed building wheel for cryptography
  Running setup.py bdist_wheel for cffi
  Complete output from command /media/{me}/{route}/doconenv/bin/python -c "import setuptools;__file__='/tmp/pip-build-SsTBPB/cffi/setup.py';exec(compile(open(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" bdist_wheel -d /tmp/tmpNAcsxupip-wheel-:
  running bdist_wheel
  running build
  running build_py
  creating build
  creating build/lib.linux-x86_64-2.7
  creating build/lib.linux-x86_64-2.7/cffi
  copying cffi/ffiplatform.py -> build/lib.linux-x86_64-2.7/cffi
  copying cffi/model.py -> build/lib.linux-x86_64-2.7/cffi
  copying cffi/recompiler.py -> build/lib.linux-x86_64-2.7/cffi
  copying cffi/__init__.py -> build/lib.linux-x86_64-2.7/cffi
  copying cffi/setuptools_ext.py -> build/lib.linux-x86_64-2.7/cffi
  copying cffi/lock.py -> build/lib.linux-x86_64-2.7/cffi
  copying cffi/vengine_gen.py -> build/lib.linux-x86_64-2.7/cffi
  copying cffi/cffi_opcode.py -> build/lib.linux-x86_64-2.7/cffi
  copying cffi/api.py -> build/lib.linux-x86_64-2.7/cffi
  copying cffi/backend_ctypes.py -> build/lib.linux-x86_64-2.7/cffi
  copying cffi/verifier.py -> build/lib.linux-x86_64-2.7/cffi
  copying cffi/vengine_cpy.py -> build/lib.linux-x86_64-2.7/cffi
  copying cffi/gc_weakref.py -> build/lib.linux-x86_64-2.7/cffi
  copying cffi/commontypes.py -> build/lib.linux-x86_64-2.7/cffi
  copying cffi/cparser.py -> build/lib.linux-x86_64-2.7/cffi
  copying cffi/_cffi_include.h -> build/lib.linux-x86_64-2.7/cffi
  copying cffi/parse_c_type.h -> build/lib.linux-x86_64-2.7/cffi
  running build_ext
  building '_cffi_backend' extension
  creating build/temp.linux-x86_64-2.7
  creating build/temp.linux-x86_64-2.7/c
  x86_64-linux-gnu-gcc -pthread -fno-strict-aliasing -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fPIC -DUSE__THREAD -I/usr/include/python2.7 -c c/_cffi_backend.c -o build/temp.linux-x86_64-2.7/c/_cffi_backend.o
  c/_cffi_backend.c:2:20: fatal error: Python.h: No existe el archivo o el directorio
   #include <Python.h>
                      ^
  compilation terminated.
  error: command 'x86_64-linux-gnu-gcc' failed with exit status 1

  ----------------------------------------
  Failed building wheel for cffi
Failed to build cryptography cffi
Installing collected packages: cffi, cryptography
  Running setup.py install for cffi
    Complete output from command /media/{me}/{route}/doconenv/bin/python -c "import setuptools, tokenize;__file__='/tmp/pip-build-SsTBPB/cffi/setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /tmp/pip-nbEEUN-record/install-record.txt --single-version-externally-managed --compile --install-headers /media/{me}/{route}/doconenv/include/site/python2.7/cffi:
    running install
    running build
    running build_py
    running build_ext
    building '_cffi_backend' extension
    x86_64-linux-gnu-gcc -pthread -fno-strict-aliasing -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fPIC -DUSE__THREAD -I/usr/include/python2.7 -c c/_cffi_backend.c -o build/temp.linux-x86_64-2.7/c/_cffi_backend.o
    c/_cffi_backend.c:2:20: fatal error: Python.h: No existe el archivo o el directorio
     #include <Python.h>
                        ^
    compilation terminated.
    error: command 'x86_64-linux-gnu-gcc' failed with exit status 1

    ----------------------------------------
Command "/media/{me}/{route}/doconenv/bin/python -c "import setuptools, tokenize;__file__='/tmp/pip-build-SsTBPB/cffi/setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /tmp/pip-nbEEUN-record/install-record.txt --single-version-externally-managed --compile --install-headers /media/{me}/{route}/doconenv/include/site/python2.7/cffi" failed with error code 1 in /tmp/pip-build-SsTBPB/cffi

我应该补充一点,我正在使用 Linux Mint 17.1


您需要安装Python和其他库开发包,例如如果您使用Ubuntu,请运行以下命令:

sudo apt-get install libpython2.7-dev
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)

virtualenv 上的 pip install requests[security] 无法构建密码学和 cffi 轮子 的相关文章

随机推荐

  • 多个 Asp.Net 项目之间的共享代码 [重复]

    这个问题在这里已经有答案了 在同一服务器上的多个 Web 应用程序之间共享 bin 文件夹和 dll 以及其他资源文件 如 css 的最佳实践是什么 我已经将通用代码分离到它们自己的程序集中 但我想知道部署等 我基本上希望将所有通用文件位于
  • Meteor 需要时间才能知道是否存在 {{currentUser}}

    我有一些代码 我只想在存在时运行noUser和一些当有currentUser 所有这些都在导航模板内 就像这样 if currentUser li class nav a href Post a li li class nav a Ola
  • 如何在 Chrome 扩展程序中录制音频?

    设置 Chrome 扩展程序以从麦克风录制音频的最简单方法是什么 我看到有一个工作实验性语音输入API http code google com chrome extensions trunk experimental speechInpu
  • 将参数传递给函数以使用 ggplot stat_function 进行绘图

    我有一个函数和一个参数列表 F lt function a b a b b a L lt list a 5 b 2 c 0 我想用未知的 x 或 x 替换参数之一 a b 或 c 并使用 ggplot 的 stat function 进行绘
  • Unity 与 ASP.NET Core 和 MVC6(核心)

    更新 09 08 2018Unity正在开发中here https github com unitycontainer container但我还没有时间测试它如何与 ASP NET Core 框架配合使用 更新 15 03 2018此解决方
  • BindingList.Sort() 的行为类似于 List.Sort()

    我正在尝试编写一个可用于我的应用程序的 SortableBindingList 我发现了很多关于如何实现基本排序支持的讨论 以便 BindingList 在 DataGridView 或其他一些绑定控件的上下文中使用时进行排序 包括来自 S
  • 结束动画事件android

    我在视图中有一个淡出动画 位于片段内 每次动画发生时 视图完成后都会再次重新绘制自身 我找到了一个解决办法view SetVisibility View GONE 但它不会等待动画完成 我想仅在动画完成后执行此 setVisibility
  • 如何在 SPA 中实施 Docusign,而不要求最终用户使用 DocuSign 进行身份验证

    我正在关注此处显示的 React OAuth 隐式示例 https github com docusign eg 02 react implicit grant https github com docusign eg 02 react i
  • WPF MergedDictionaries - 值不能为空 - 参数名称:item

    我的 App Resources MergedDictionary 遇到了一个棘手的问题 每次添加带有来自另一个程序集的源和 XML 命名空间的新字典时 都会产生错误 并且我无法构建我的程序 该错误出现在 App xaml 中 并带有下划线
  • BigQuery 完全外连接生成“左连接”结果

    我有 2 个表 它们都包含不同的 id 值 有些 id 值可能出现在两个表中 有些对于每个表来说是唯一的 表 1 有 10 910 行 表 2 有 11 304 行 运行左连接查询时 SELECT COUNT DISTINCT a id F
  • 多语言集成测试框架

    想象一下 您有一个由不同组件组成的相当复杂的面向服务的体系结构 组件是用不同的语言 Java PHP Ruby 编写的 并以不同的方式相互通信 即 UI REST API 在某些情况下共享一些数据库表等 我正在尝试为一些端到端测试设计一个集
  • AGDA 中极浅嵌入 VHDL 的指南

    对于我的编程语言项目 我正在 agda 中做一个非常浅且简单的 VHDL 数字电路嵌入 目的是写出语法 静态语义 动态语义 然后写一些证明来展示我们对材料的理解 到目前为止我已经编写了以下代码 data Ckt Set where var
  • 为什么我无法访问 Google Compute Engine 虚拟机?

    我无法访问 Google 计算引擎 GCE 虚拟机 GCE INSTANCE NAME 与 Google Cloud SDK gcloud gcloud compute project GCP PROJECT ID ssh zone GCE
  • 使用 JavaScript 将图像从 A 移动到 B

    这是我第一次来这里 我不知道如何缩进这个抱歉 我有一张货车的图像 我试图将其移动到屏幕上 就像它正在行驶一样 完成后 我将缩放图像 使其看起来好像它正在移动 并且变小 我需要在标准 javascript 中完成此操作 无需任何包 例如 JQ
  • 将 np.float64 和 np.array 值存储为数据帧中的列值

    我有两个 numpy 数组和数据框 如下所示 val np array 0 501 0 32 values np arange 24 reshape 2 3 4 input df pd DataFrame columns colname s
  • 如何全局禁用grails中的deepvalidate?

    我们如何在 grails3 的全局级别上禁用深度验证 就像在我们保存一个域对象的情况下一样 它试图保存所有内部域对象 从而导致不同的错误 例如唯一约束等 我们正在使用 mongodb Grails 版本 3 3 2 Gorm 版本 6 1
  • 添加 servlet 以在 Intershop 7.4 应用程序服务器上下文中运行

    我正在尝试包含一个第三方 servlet 以在我们的 IS7 应用程序服务器的上下文中运行 我将如何添加 servlet 并映射到 web xml 在知识库中 我只找到了有关 Enfinity Suite 6 的信息 所提供的步骤似乎都不起
  • 如何使用 SQL Server 与本周进行比较?

    如何将 SQL Server 日期列与本周进行比较 例如 WHERE Order SubmittedDate THIS WEEK 您可以将日期转换为周数 并将其与当前日期的周数进行比较 同样 您还需要比较年份 这样您就不会得到去年的几周 W
  • SQL Server 获取序列的多个下一个值

    在 SQL Server 中 您可以从如下序列中选择下一个值 select next value for MY SEQ 如果您不抑制要从中选择的表 则对于每一行 将输出下一个值 select next value for MY SEQ fr
  • virtualenv 上的 pip install requests[security] 无法构建密码学和 cffi 轮子

    跟随时this http docs python guide org en latest dev virtualenvs and this https www jeffknupp com blog 2012 02 09 starting a