使用python安装crypto问题

使用python安装crypto问题,python,cryptography,Python,Cryptography,我有一些使用加密的python代码 from Crypto.Random.random import getrandbits from Crypto import Random from Crypto.Random import random from Crypto.PublicKey import ElGamal import socket import time 当我运行该文件时,我得到了错误回溯(最近一次调用):文件“/alice_solution.py”,第6行,from Crypt

我有一些使用加密的python代码

from Crypto.Random.random import getrandbits
from Crypto import Random
from Crypto.Random import random
from Crypto.PublicKey import ElGamal
import socket
import time

当我运行该文件时,我得到了错误
回溯(最近一次调用):文件“/alice_solution.py”,第6行,from Crypto.Random.Random import getrandbits modulenofounderror:没有名为“Crypto”的模块

当我尝试安装模块pip install Crypto时,出现以下错误:

pip is configured with locations that require TLS/SSL, however the ssl module in Python is not available.
Collecting Crypto
  Retrying (Retry(total=4, connect=None, read=None, redirect=None, status=None)) after connection broken by 'SSLError("Can't connect to HTTPS URL because the SSL module is not available.")': /simple/crypto/
  Retrying (Retry(total=3, connect=None, read=None, redirect=None, status=None)) after connection broken by 'SSLError("Can't connect to HTTPS URL because the SSL module is not available.")': /simple/crypto/
  Retrying (Retry(total=2, connect=None, read=None, redirect=None, status=None)) after connection broken by 'SSLError("Can't connect to HTTPS URL because the SSL module is not available.")': /simple/crypto/
  Retrying (Retry(total=1, connect=None, read=None, redirect=None, status=None)) after connection broken by 'SSLError("Can't connect to HTTPS URL because the SSL module is not available.")': /simple/crypto/
  Retrying (Retry(total=0, connect=None, read=None, redirect=None, status=None)) after connection broken by 'SSLError("Can't connect to HTTPS URL because the SSL module is not available.")': /simple/crypto/
  Could not fetch URL https://pypi.org/simple/crypto/: There was a problem confirming the ssl certificate: HTTPSConnectionPool(host='pypi.org', port=443): Max retries exceeded with url: /simple/crypto/ (Caused by SSLError("Can't connect to HTTPS URL because the SSL module is notavailable.")) - skipping
  Could not find a version that satisfies the requirement Crypto (from versions: )
No matching distribution found for Crypto
You are using pip version 18.0, however version 20.3b1 is available.
You should consider upgrading via the 'pip install --upgrade pip' command.

请帮忙。。。我试图研究这个问题,但没有发现任何有效的方法。ssl模块是Python本身的标准库模块
pip
要求它能够通过TLS获取资源。如果您自己编译此Python,则需要确保具有正确的依赖项(例如openssl开发头等)。如果没有,请与平台的软件包管理器联系,查看是否有其他提供此功能的软件包需要安装。

您是否尝试过错误消息最后一行的建议?另外,您正在运行哪个版本的python?@PresidentJamesK.Polk它会给我相同的错误:
无法获取URLhttps://pypi.org/simple/pip/: 确认ssl证书时出现问题:HTTPSConnectionPool(host='pypi.org',port=443):url:/simple/pip/(由SSLError引起)超过了最大重试次数(“无法连接到HTTPS URL,因为SSL模块不可用。”)-跳过
@PresidentJamesK.Polk python3是3.7.0,python是2.7.0