如何为确定的 python 版本安装 pycrypto 模块

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/16581278/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-18 23:05:12  来源:igfitidea点击:

How to install the pycrypto module for a definite python version

pythonubuntupycrypto

提问by webstyle

I'm trying to install "Userful MultiSeat-X64-5.0.1 ..." in Ubuntu 13.04 x64, and encountered the following error at the end of the installation:

我正在尝试在 Ubuntu 13.04 x64 中安装“Userful MultiSeat-X64-5.0.1 ...”,在安装结束时遇到以下错误:

File "<string>", line 6, in <module>
ImportError: No module named Crypto.Cipher

This message means, that there is no pycrypto module.

此消息意味着没有 pycrypto 模块。

There is how I should install it:

我应该如何安装它:

pip install pycrypto

But the problem is that userful5 requires python 2.6 to work and ubuntu 13.04 uses python 2.7 as default. I've installed python 2.6, but I don't know how to install the pycrypto module for it.

但问题是 userful5 需要 python 2.6 才能工作,而 ubuntu 13.04 默认使用 python 2.7。我已经安装了 python 2.6,但我不知道如何为其安装 pycrypto 模块。

pip install pycrypto

returns:

返回:

Requirement already satisfied (use --upgrade to upgrade): pycrypto in /usr/lib/python2.7/dist-packages

As I understand, this module is already installed in python 2.7 But how can I install it to python 2.6?

据我了解,这个模块已经安装在 python 2.7 中,但是如何将它安装到 python 2.6 中?

采纳答案by residante

You should use pip for python2.6 (or easy_install)

你应该使用 pip for python2.6(或easy_install)

pip-2.6 install pycrypto

Use easy_install to get pip-2.6

使用easy_install获取pip-2.6

easy_install-2.6 pip
pip-2.6 install pycrypto