from Crypto.Cipher import AES
from Crypto.Cipher import AES
。我寻找重复项,你可能会说有一些,但我尝试了解决方案(尽管大多数甚至都不是解决方案),但没有任何效果。
36 Answers 36 个答案
- 6
It's odd, but this fixed the issue on OS X Mavericks for me. I needed sudo for system wide libs. 这很奇怪,但这为我解决了 OS X Mavericks 上的问题。我需要 sudo 来获取系统范围的库。 – PaulMay 19, 2014 at 9:09 - 2
thanks elad, i'm using 10.9.3 and i got same error. thanks a million 谢谢elad,我正在使用 10.9.3,但遇到了同样的错误。谢谢一百万 –Jun 2, 2014 at 19:32user1173426 用户1173426 - 4
Aug 23, 2015 at 23:04I had installed it with pip, which didn't work, then easy_install, which also didn't work. (This is on Windows.) Simply uninstalling it with pip as you suggested somehow made it work. I would have never thought to do that in a million years. Thank you. 我用 pip 安装了它,但它不起作用,然后是 easy_install,它也不起作用。 (这是在 Windows 上。)只需按照您的建议用 pip 卸载它就可以了。我从来没想过在一百万年内会这么做。谢谢。 - 6
- 3
Jun 2, 2016 at 18:47Can anyone explain why this works? (on OSX 10.11.4 with python from homebrew) 谁能解释为什么这有效? (在 OSX 10.11.4 上,使用自制程序中的 python)
- 1
Dec 30, 2019 at 1:34If you currently have installations of crypto or pycrypto, you must uninstall them first. 如果您当前安装了 crypto 或 pycrypto,则必须先卸载它们。 - 3
It is fixed now Jan 16, 2021 at 17:15security-tracker.debian.org/tracker/CVE-2013-7459 现已修复 security-tracker.debian.org/tracker/CVE-2013-7459 - 5
The only answer worked for me - 唯一的答案对我有用 - pip install pycryptodome
。pip install pycryptodome
Feb 15, 2021 at 8:32 pip install pycryptodome
Jun 20, 2021 at 2:56worked!!! ( macOS) and the virtual environment is good too. a perfect cubicle for individual project. Awesome and thanks!! pip install pycryptodome
成功了!!! (macOS)和虚拟环境也很好。适合个人项目的完美隔间。太棒了,谢谢!!- 2
Dec 2, 2021 at 19:08I still get the Crypto module not found using this library as well 我仍然使用这个库找不到加密模块
Sep 13, 2017 at 12:24Same for me in Windows+Vagrant with Ubuntu 14.04 64-bit and Python3 对于我来说,使用 Ubuntu 14.04 64 位和 Python3 的 Windows+Vagrant 也是如此 Jul 9, 2018 at 20:41This works except that in a virtualenv don't use sudo 除了在 virtualenv 中不使用 sudo 之外,这是有效的
- 1
Just to add to this a little more, in my case this wasn't working as I had multiple versions of Python interpreters on my machine and I was installing the libraries in different versions. What I did was moved into the virtual environment and it worked as smooth as silk. 补充一点,就我而言,这不起作用,因为我的机器上有多个版本的 Python 解释器,并且我正在安装不同版本的库。我所做的事情被转移到虚拟环境中,并且工作起来像丝绸一样顺利。 – neaGazeAug 5, 2017 at 15:30 Feb 3, 2018 at 1:45@neaGaze How did you "move into the virtual environment" to get it to work "smooth as silk"? @neaGaze 你是如何“进入虚拟环境”并使其“如丝般顺畅”工作的? - 1
@Praxiteles Well it's been a while since I did that project but I think I used the Python virtual env setting. In Python you can either use a standalone version or the virtual environment. You can check out this link if you need more information pythonforbeginners.com/basics/how-to-use-python-virtualenv – neaGazeFeb 4, 2018 at 15:39@Praxiteles 自从我做那个项目以来已经有一段时间了,但我想我使用了 Python 虚拟环境设置。在 Python 中,您可以使用独立版本或虚拟环境。如果您需要更多信息,可以查看此链接 pythonforbeginners.com/basics/how-to-use-python-virtualenv - 16
This answer does not explain everything, where are you getting app.yaml
file? – VishrantJun 12, 2019 at 3:34这个答案并不能解释一切,你从哪里得到 app.yaml
文件? - 4
You shouldn't use pycrypto
Sep 25, 2019 at 8:19no more! Check my answer for a better solution! 您不应该再使用 pycrypto
了!检查我的答案以获得更好的解决方案!
This works, but there are too many of packages inside all need to be renamed. 这可行,但是里面有太多包都需要重命名。 – AlexJan 18, 2019 at 19:24@user1288329 Why would that be the case? Other packages are imported lowercase. Only renaming as Crypto worked for me. @user1288329 为什么会这样呢?其他包都是小写导入的。只有重命名为 Crypto 对我有用。 – BurakDec 6, 2020 at 15:57- 1
This problem probably occurs because crypto
was installed before, which created the directory lowercase. And case insensitive Windows put all things in the same directory afterwards. – BurakDec 6, 2020 at 15:58出现此问题的原因可能是之前安装了 crypto
,从而创建了小写目录。并且不区分大小写的 Windows 之后将所有内容都放在同一目录中。 - 3
I have run into this problem so many times and have never solved it. You, my good sir, are both a gentleman and a scholar. <hat tip> 我已经多次遇到这个问题并且从未解决过。您,我的好先生,既是一位绅士,又是一位学者。 <帽子提示> – escuelleJan 20, 2021 at 14:31 the uppercase crypto will change to lowercase automatically sometimes, it it possible to fixed is forever? 大写的密码有时会自动变成小写,有可能永远固定吗? – DolphinNov 17, 2023 at 7:56
That's not correct, read a bit here: May 16, 2020 at 20:13pycryptodome.readthedocs.io/en/latest/src/… 这是不正确的,请在这里阅读一下:pycryptodome.readthedocs.io/en/latest/src/...
- 1
Here is the explanation to this solution from the docs: Oct 29, 2019 at 18:45pycryptodome.readthedocs.io/en/latest/src/… 以下是文档中对此解决方案的解释:pycryptodome.readthedocs.io/en/latest/src/... This worked for me, except with pycryptodome
and pycryptodomex
Mar 17, 2021 at 18:39除了 pycryptodome
和pycryptodomex
之外,这对我有用。
I found this while searching for a Linux solution (Debian). The following worked for me: Feb 4, 2015 at 19:02Can't install python module “pycrypto” on Debian lenny 我在寻找 Linux 解决方案(Debian)时发现了这个。以下对我有用: Can't install python module “pycrypto” on Debian lenny
- 1
Feb 24, 2020 at 21:52This one worked for me as opposed to other solutions. I am on MacOs 与其他解决方案相反,这个解决方案对我有用。我在 MacO 上 Buried here is the solution that worked for me (on Windows 10) 这里埋的是对我有用的解决方案(在 Windows 10 上) – JosephMay 16, 2020 at 6:01This work for me on macOS 13.4 with M1 pro chip. why did this solve the issue? 这对我来说适用于配备 M1 pro 芯片的 macOS 13.4。为什么这解决了问题? – DolphinNov 15, 2023 at 8:16
May 18, 2022 at 9:04is this library issue with different versions of python? Seemed to work fine for python 2 这个库是不同版本的 python 的问题吗?似乎对 python 2 工作得很好 - 2
Problem with possible python versions. Please use one of the current python versions 可能的 python 版本有问题。请使用当前的 python 版本之一 – isaMay 18, 2022 at 12:16
- 1
the OP's question has to do with Windows and not OSX OP的问题与Windows有关,而不是OSX – galdinSep 20, 2014 at 13:54 It might be useful to note that installing to the project root will also work (regardless of platform) 注意到安装到项目根目录也可以工作(无论平台如何)可能会很有用 – ocodoNov 18, 2014 at 23:59 Apr 23, 2015 at 11:48@Lazaros Dinakis : This is the solution that worked.. of all the solutions mentioned in this page. Thanks @Lazaros Dinakis:这是本页提到的所有解决方案中有效的解决方案。谢谢 Nov 10, 2015 at 14:17this answer solved it for me on mac OSX Yosemite 10.10.5. Only thing is the installation failed with errors for me. so i manually copied the Crypto lib from my python lib into the google_appengine lib. and now it works. 这个答案在 mac OSX Yosemite 10.10.5 上为我解决了这个问题。唯一的问题是安装失败并出现错误。所以我手动将 Crypto lib 从 python lib 复制到 google_appengine lib 中。现在可以了。
- 1
This package name referenced seems to no longer exist on yum? "pycrypto" yum 上好像已经不存在这个引用的包名了? “pycrypto” – k1DBLITZNov 30, 2017 at 16:49
Your answer could be improved with additional supporting information. Please 通过额外的支持信息可以改进您的答案。请 edit 编辑 to add further details, such as citations or documentation, so that others can confirm that your answer is correct. You can find more information on how to write good answers 添加更多详细信息,例如引文或文档,以便其他人可以确认您的答案是正确的。您可以找到有关如何写出好的答案的更多信息 in the help center 在帮助中心 . 。 – CommunityJan 9, 2023 at 14:31Bot 机器人
Not the answer you're looking for? Browse other questions tagged ask your own question. or
来自 https://stackoverflow.com/questions/19623267/importerror-no-module-named-crypto-cipher
ImportError
python 2
python 3
ModuleNotFoundError
ImportError
显示在python 2
中,而在python 3
中显示ModuleNotFoundError
。python3 -c 'import foo'
ImportError: No module named 'foo'
python3 -c 'import foo'
产生ImportError: No module named 'foo'
。我错过了什么吗?