无法在 Debian lenny 上安装 python 模块“pycrypto”

2024-07-04

我尝试通过下载源代码并执行以下命令来安装 pycrypto 模块python setup.py install,然后出现错误

running install
running build
running build_py
running build_ext
warning: GMP library not found; Not building Crypto.PublicKey._fastmath.
building 'Crypto.Hash.MD2' extension
gcc -pthread -fno-strict-aliasing -fwrapv -Wall -Wstrict-prototypes -fPIC -std=c99 -O3 -fomit-frame-pointer -Isrc/ -I/usr/include/python2.5 -c src/MD2.c -o build/temp.linux-x86_64-2.5/src/MD2.o
src/MD2.c:31:20: error: Python.h: No such file or directory
src/MD2.c:118: error: expected '=', ',', ';', 'asm' or '__attribute__' before '*' token
In file included from src/MD2.c:134:
src/hash_template.c:42: error: expected specifier-qualifier-list before 'PyObject_HEAD'
src/hash_template.c:46: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'PyTypeObject'
src/hash_template.c: In function 'newALGobject':
src/hash_template.c:55: warning: implicit declaration of function 'PyObject_New'
src/hash_template.c:55: error: expected expression before 'ALGobject'
src/hash_template.c:55: warning: assignment makes pointer from integer without a cast
src/hash_template.c: At top level:
src/hash_template.c:62: error: expected ')' before '*' token
src/hash_template.c:77: error: expected '=', ',', ';', 'asm' or '__attribute__' before '*' token
src/hash_template.c:96: error: expected '=', ',', ';', 'asm' or '__attribute__' before '*' token
src/hash_template.c:108: error: expected '=', ',', ';', 'asm' or '__attribute__' before '*' token
src/hash_template.c:143: error: expected '=', ',', ';', 'asm' or '__attribute__' before '*' token
src/hash_template.c:160: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'ALG_methods'
src/hash_template.c:169: error: expected '=', ',', ';', 'asm' or '__attribute__' before '*' token
src/hash_template.c:178: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'ALGtype'
src/hash_template.c:203: error: expected '=', ',', ';', 'asm' or '__attribute__' before '*' token
src/hash_template.c:237: error: array type has incomplete element type
src/hash_template.c:238: error: 'PyCFunction' undeclared here (not in a function)
src/hash_template.c:238: error: expected '}' before 'ALG_new'
src/hash_template.c: In function 'initMD2':
src/hash_template.c:254: error: 'PyObject' undeclared (first use in this function)
src/hash_template.c:254: error: (Each undeclared identifier is reported only once
src/hash_template.c:254: error: for each function it appears in.)
src/hash_template.c:254: error: 'm' undeclared (first use in this function)
src/hash_template.c:256: error: 'ALGtype' undeclared (first use in this function)
src/hash_template.c:256: error: 'PyType_Type' undeclared (first use in this function)
src/hash_template.c:257: warning: implicit declaration of function 'Py_InitModule'
src/hash_template.c:260: error: 'o' undeclared (first use in this function)
src/hash_template.c:260: warning: implicit declaration of function 'PyInt_FromLong'
src/hash_template.c:260: warning: implicit declaration of function 'PyDict_SetItemString'
src/hash_template.c:260: warning: implicit declaration of function 'PyModule_GetDict'
src/hash_template.c:260: warning: implicit declaration of function 'Py_DECREF'
src/hash_template.c:263: warning: implicit declaration of function 'PyErr_Occurred'
src/hash_template.c:264: warning: implicit declaration of function 'Py_FatalError'
error: command 'gcc' failed with exit status 1

这意味着他没有找到Python.h。我在网上搜索了这个错误,似乎通过安装 python 头文件就可以解决问题,但是我的 Debian lenny 出现了另一个错误。

apt-get install python2.6-dev

和错误:

Reading package lists... Done
Building dependency tree
Reading state information... Done
E: Couldn't find package python2.6-dev

不要从源安装它。安装 Debian 软件包:

aptitude install python-crypto

并安装 python 开发文件(如果您遵循我的上述建议,您将不需要这些文件):

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

无法在 Debian lenny 上安装 python 模块“pycrypto” 的相关文章

  • 在python绑定/clang中的get-includes中解析cpp文件时过滤目录

    我应该编写一个 python clang 解析器 它返回 cpp 文件中的所有包含内容 所以我使用像下面的代码这样的东西 def main from clang cindex import Index from optparse impor
  • 配置 argparse 以接受带引号的参数

    我正在编写一个程序 除其他外 它允许用户通过参数指定要加载的模块 然后用于执行操作 我试图建立一种方法来轻松地将参数传递到这个内部模块 并且我试图使用 ArgParse 的action append 让它构建一个参数列表 然后我将通过它 这
  • Flask:如何从模板目录下提供静态文件?

    我使用 Flask 并想要更改我的资产文件夹目录 这是我的文件夹结构 python static js img font css templates default css js img venv app py 我想移动静态文件夹下的所有文
  • 从子列表中切片元素 - Python

    我想从中返回数字 5 list 1 1 2 3 4 5 6 我以为这会起作用 但事实并非如此 print list 1 1 1 它返回一个空列表 它是索引 1 第二个列表 和位置 1 列表中的第二个数字 这不应该起作用吗 您需要两个单独的操
  • 使用 Python 在 Yandex Images 中反向搜索图像

    我对自动化反向图像搜索感兴趣 Yandex 特别适合捕捞鲶鱼 甚至比 Google 图片还要好 因此 请考虑以下 Python 代码 import requests import webbrowser try filePath C path
  • 了解 Python 2.7 中 io.open() 方法的缓冲参数

    我试图理解的缓冲参数io open https docs python org 2 library functions html openPython 2 7 中的方法 我在Python解释器中执行 import utils buffer
  • 获取pygame中图像各个像素的颜色

    如何获取传输到 pygame 表面的图像像素的颜色值 使用 Surface get at 仅返回表面层的颜色 而不返回其上位图传输的图像 方法surface get at很好 下面的示例显示了在没有 Alpha 通道的情况下位图传输图像时的
  • Pandas:处理测试中看不见的数据

    我有一个训练数据集 正在构建一些机器学习模型 我无权访问测试集 并且想要处理在训练中未观察到测试中的分类特征之一的可能性 这是一个玩具示例 说明了我的意思 我有一个数据框 old 像这样 old pd DataFrame car Audi
  • Python将html ascii编码文本转换为utf8

    我有一个 xml 文件 需要将其转换为 utf8 不幸的是 这些实体包含这样的文本 047 mytext 044 我正在使用编解码器库将文件转换为 utf8 但 html 实体无法使用它 有没有一种简单的方法可以摆脱html编码 Thank
  • 嵌入式Python,导入数学错误

    首先我使用的是 Mac OSX 10 12 6 我想在我的 C 应用程序中嵌入 python 环境 我把 github python 项目放在https github com python cpython https github com
  • 解析srt字幕

    我想解析srt字幕 1 00 00 12 815 gt 00 00 14 509 Chlapi jak to jde s t ma pracovn ma sv tlama 2 00 00 14 815 gt 00 00 16 498 Tro
  • 使用 python 将数据复制到 Vertica

    I use python and vertica python图书馆到COPY数据到Vertica DB connection vertica python connect conn info vsql cur connection cur
  • 添加 prefix_with 子句以插入特定类

    我怎样才能定制prefix withSQLAlchemy 中的每个模型类 以便每个模型类都可以有不同的插入语句 我其实想要OR IGNORE子句添加到某些类中 PS 我对 SQLAlchemy 比较陌生 ORM 没有挂钩它的生成方式inse
  • id 是 python 中的关键字吗?

    我的编辑器 TextMate 显示id使用与我常用的变量名称不同的颜色 当用作变量名称时 是关键字吗 我不想遮蔽任何关键字 id不是一个keyword在Python中 但它是一个的名字内置功能 http docs python org li
  • 删除超过 7 天的文件

    我看过一些帖子删除特定文件夹中的所有文件 不是文件夹 但我根本不明白它们 我需要使用 UNC 路径并删除所有超过 7 天的文件 Mypath files data APIArchiveFolder 有人有快速脚本 可以专门输入上面的路径来删
  • Python 中的 HTML 解析器 [关闭]

    Closed 这个问题正在寻求书籍 工具 软件库等的推荐 不满足堆栈溢出指南 help closed questions 目前不接受答案 使用Python文档我发现了HTML解析器 http docs python org lib modu
  • Python 解释器优化

    假设我有一个字符串x Python 解释器是否足够聪明 能够知道 string replace x x 应转换为NOP 我怎样才能找到这个 是否有任何参考资料显示解释器能够根据句法分析动态执行哪种类型的优化 不 Python 不能对 NOP
  • 如何让机器人加入语音频道discord.py

    我正在使用 Discord py 创建音乐机器人 但我在将该机器人连接到语音通道时遇到问题 我使用 Cog 将音乐功能与其他功能分开 commands command async def join voice self ctx channe
  • Python:汇总和聚合 DataFrame 中的组和子组

    我正在尝试构建一个表 其中的组按子组划分 并包含每个子组的计数和平均值 例如 我想转换以下数据框 到一个看起来像这样的表 其中interval是一个更大的组和列a thru i成为组内的子组 每个单元格中具有相应子组的计数和平均值 我尝试过
  • 来自 Abaqus/CAE 的 Python 多处理

    I am using a commercial application called Abaqus CAE1 with a built in Python 2 6 interpreter and API I ve developed a l

随机推荐

  • 使用lib添加自定义字体android

    我正在使用 android 自定义字体 lib Calligraphyhttps github com chrisjenx Calligraphy https github com chrisjenx Calligraphy 但对textv
  • Blazor - 重定向到一个解决方案中另一个项目中的页面

    我遇到了这样的情况 在一个解决方案中 想要将用户从一个项目的页面重定向到另一个项目的页面 这很重要 我在 blazor 服务器上做 任何人都可以教我一些东西吗 您始终可以注入 NavigationManager 通过此您可以将用户重定向到另
  • 来自 Abaqus/CAE 的 Python 多处理

    I am using a commercial application called Abaqus CAE1 with a built in Python 2 6 interpreter and API I ve developed a l
  • 使用 PowerShell 中的“备份”上下文创建卷影副本

    我正在编写一个 PowerShell 脚本 用于使用 rsync 备份 Windows 计算机 为此 我尝试使用所述脚本中的 WMI 创建一个有编写者参与的非持久卷影副本 显然建议备份 我从另一个问题中得知 从 Powershell 访问卷
  • 过滤(减少)NumPy 数组

    假设我有一个 NumPy 数组arr我想根据 可广播 函数的真值进行逐元素过滤 减少 例如 我只想获取低于某个阈值的值k def cond x return x lt k 有几种方法 例如 使用发电机 np fromiter x for x
  • 如何使信号客户端避免表单身份验证?

    我的 MVC 网站在 web config 中有表单授权 现在所有的页面都需要通过授权才能被查看 但是现在我有一个控制台程序 C 控制台程序 这个程序需要发送一些消息到 SignalR 集线器 但是我的 signalR Hub 在我的 MV
  • 使用相同的 URL 哈希刷新 BackboneJS? [复制]

    这个问题在这里已经有答案了 我当前的主干应用程序有一个 url localhost users 有没有办法访问localhost users当位于 URL 时localhost users所以它会刷新页面 目前 当我在localhost u
  • 使用关联类实现双向、多对多关联的流畅 NHibernate 映射

    我在 EntityA 和 EntityB 之间有一个双向多对多关联 并且我使用关联类 EntityABLink 对此进行建模 因为我需要跟踪有关该关系的其他属性 此外 我还有另一个类 它保存对 EntityA 和 EntityB 之间特定关
  • 不固定高度的滚动div

    我需要构建一个动态调整大小的滚动 div div 应动态调整大小以适应屏幕 但如果内容不适合屏幕 它应该显示一个滚动条 因此浏览器自己的滚动条永远不需要激活 我可以通过在 div 中放置另一个 div 并使用来让滚动条出现在 div 中ov
  • 如何获取对象类型

    在我的 Google Apps 脚本应用程序中 我看到以下错误 脚本已完成 但返回值不是受支持的返回类型 如何找出我返回的值的类型 我试过 typeof obj 但我得到的只是它是一个对象 仅当缓存为空并且从电子表格加载数据时才会发生此错误
  • React-native 应用程序在真实的 Android 设备上崩溃

    我正在使用react native 目前开始使用redux并创建了一个应用程序 但是当我在模拟器上运行该应用程序时 它工作正常 然后我通过 USB 将我的手机与 android 6 连接 它也可以工作 但在 Android 8 的其他设备中
  • 如何通过参数包传递引用?

    我有以下代码 include
  • iOS 版本的 Fragment

    谁能告诉我在 Xcode iPhone 中执行以下操作的最佳方法是什么 我有一个主导航屏幕 上面有一些按钮 当用户单击任何按钮时 他们将进入带有更多选项按钮的子导航屏幕 在这里 他们单击任意按钮 就会看到选项列表 单击任何列表选项都会向用户
  • 如何在R函数中使用switch语句?

    我想在 R 中的函数中使用以下语句switch 根据函数参数的值触发不同的计算 例如 在 Matlab 中 您可以通过编写来做到这一点 switch AA case 1 case 2 case 3 end 我找到了这个帖子 switch 语
  • Node Sass 缺少多个节点版本的绑定

    我正在使用 nvm 在节点版本之间切换 我的package json scripts dev rm rf public assets hot update js NODE ENV development webpack env dev pr
  • 在 JavaScript 中将数字转换为字符串,而不从数字中添加尾随零

    我尝试使用 toString 在 JavaScript 中将数字转换为字符串 但它会截断数字中无关紧要的零 举些例子 var n1 250 00 var n2 599 0 var n3 056 0 n1 toString yields 25
  • Laravel 使用 mysql 索引

    我有这个糟糕的代码 抱歉 它使用了太多 MySQL 查询 抱歉它太长了 return view dashboard homepage array DriversNumberApproved gt App Models Drivers whe
  • GWT UiBinder 不加载样式表

    我想使用 UiBinder 制作一个 GWT 小部件 所以我做了 UserPanel ui xml 像这样
  • IF 语句中间的 GO 命令

    我正在寻找有关创建表的信息 仅当它们在当前数据库中不存在时 以便能够在可能或可能没有它们的不同数据库中创建它 并发现这两个有用的主题 SQL Server 检查表是否存在 https stackoverflow com questions
  • 无法在 Debian lenny 上安装 python 模块“pycrypto”

    我尝试通过下载源代码并执行以下命令来安装 pycrypto 模块python setup py install 然后出现错误 running install running build running build py running bu