我是靠谱客的博主 敏感鸡,最近开发中收集的这篇文章主要介绍Python3.6 ModuleNotFoundError: No module named 'Cryptodome'解决方法现象解决办法遗留问题,觉得挺不错的,现在分享给大家,希望可以做个参考。

概述

现象

之前在Mac上进行运行的程序突然不行了,报错提示ModuleNotFoundError: No module named 'Cryptodome'

www:edm user$ python3.6 crawl.py
Traceback (most recent call last):
File "crawl.py", line 9, in <module>
from Cryptodome.Cipher import AES
ModuleNotFoundError: No module named 'Cryptodome'

尝试安装Cryptodome,不对!

www:edm user$ pip3.6 install Cryptodome
Collecting Cryptodome
Could not find a version that satisfies the requirement Cryptodome (from versions: )
No matching distribution found for Cryptodome
You are using pip version 9.0.1, however version 10.0.1 is available.
You should consider upgrading via the 'pip install --upgrade pip' command.
www:edm user$ pip3.6 install --upgrade pip3.6
Collecting pip3.6
Could not find a version that satisfies the requirement pip3.6 (from versions: )
No matching distribution found for pip3.6
You are using pip version 9.0.1, however version 10.0.1 is available.
You should consider upgrading via the 'pip install --upgrade pip' command.

Google到了应该安装这个pycryptodomex,重新安装提示已经存:

www:edm user$ pip3.6 install pycryptodomex
Requirement already satisfied: pycryptodomex in /Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages
You are using pip version 9.0.1, however version 10.0.1 is available.
You should consider upgrading via the 'pip install --upgrade pip' command.

解决办法

进入site-packages 里面,发现存在两个不同版本的这个项目

drwxr-xr-x
7 www
admin
238
9
9
2017 pycryptodome-3.4.7-py3.6.egg-info
drwxr-xr-x
7 www
admin
238
9
9
2017 pycryptodomex-3.4.7-py3.6.egg-info

删除那些所有以这个开头的,然后在重新安装问题解决

cd /Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages
rm -rf pycryptodome*

遗留问题

但是为何之前OK的会突然报错不存在呢?

如果您有解答,欢迎交流 coconets@163.com

最后

以上就是敏感鸡为你收集整理的Python3.6 ModuleNotFoundError: No module named 'Cryptodome'解决方法现象解决办法遗留问题的全部内容,希望文章能够帮你解决Python3.6 ModuleNotFoundError: No module named 'Cryptodome'解决方法现象解决办法遗留问题所遇到的程序开发问题。

如果觉得靠谱客网站的内容还不错,欢迎将靠谱客网站推荐给程序员好友。

本图文内容来源于网友提供,作为学习参考使用,或来自网络收集整理,版权属于原作者所有。
点赞(40)

评论列表共有 0 条评论

立即
投稿
返回
顶部