安装软件包后出现“ ModuleNotFoundError”

时间:2020-10-27 17:06:01

标签: python cmd pip

我正在使用一个模块进行加密,并尝试通过以下方式进行安装:

C:\Users\Administrator\Desktop>python -m pip install cryptography

这是cmd窗口的副本:

Collecting cryptography

  Using cached cryptography-3.2-cp38-cp38-win32.whl (1.3 MB)

Requirement already satisfied: six>=1.4.1 in c:\users\administrator\appdata\roaming\python\python38\site-packages (from cryptography) (1.15.0)

Requirement already satisfied: cffi!=1.11.3,>=1.8 in c:\program files (x86)\python38\lib\site-packages (from cryptography) (1.14.3)

Requirement already satisfied: pycparser in c:\program files (x86)\python38\lib\site-packages (from cffi!=1.11.3,>=1.8->cryptography) (2.20)

Installing collected packages: cryptography
Successfully installed cryptography-3.2

然后,当我尝试使用该程序时,它不起作用:

C:\Users\Administrator\Desktop>main.py
Traceback (most recent call last):
  File "C:\Users\Administrator\Desktop\ape esse\main.py", line 3, in <module>
    from cryptography.fernet import Fernet
ModuleNotFoundError: No module named 'cryptography'

它给出了相同的错误,好像没有安装一样,我也不知道该怎么办。

我的一个朋友说我的python安装存在问题,但是我已经修复并重新安装了它,但仍然出现相同的错误。

1 个答案:

答案 0 :(得分:0)

我现在使用 pip install cryptography --no-cache-dir,并且在python 3.8.5上运行良好。 所以您可能想尝试一下。