Python 导入请求ModuleNotFoundError:没有名为“requests”的模块
我需要运行此代码,但发现以下错误:Python 导入请求ModuleNotFoundError:没有名为“requests”的模块,python,python-import,Python,Python Import,我需要运行此代码,但发现以下错误: Traceback (most recent call last): File "C:\Users\DELL\Downloads\snapArt.py", line 1, in <module> import requests ModuleNotFoundError: No module named 'requests' 确保您不在虚拟环境中。这可能是你的问题之一 您不会安装名为requests的模块。为此,只需打
Traceback (most recent call last):
File "C:\Users\DELL\Downloads\snapArt.py", line 1, in <module>
import requests
ModuleNotFoundError: No module named 'requests'
确保您不在虚拟环境中。这可能是你的问题之一
您不会安装名为requests的模块。为此,只需打开cmd命令提示符或终端并键入pip install requests
请注意正确的大写。这是否回答了您的问题?你真的安装了请求吗?
import requests
from hashlib import sha256
from time import time, sleep
print("""
""")
FielUser = open('Users.txt' , 'r').read().splitlines()
req = requests.session()
def token():
for i, c in enumerate("0001110111101110001111010101111011010001001110011000110001000110"):
if c == "0":
yield sha256(("iEk21fuwZApXlz93750dmW22pw389dPwOk"+"m198sOkJEn37DjqZ32lpRu76xmw288xSQ9").encode('utf-8')).hexdigest()[i]
else:
yield sha256((str(int(round(time() * 1000.0))) + "iEk21fuwZApXlz93750dmW22pw389dPwOk").encode('utf-8')).hexdigest()[i]
for user in FielUser:
if user:
user = user.strip()
url = 'https://app.snapchat.com/loq/suggest_username_v2'
headers = {'User-Agent':'Snapchat/10.25.0.0 (Agile_Client_Error; Android 5.1.1#500181103#22; gzip)'}
data = {
'req_token': "".join(list(token())),
'requested_username': user,
'timestamp': int(round(time() * 1000.0)),
'status_code': ''
}
res = req.post(url, headers=headers, data=data)
if res:
JSON = res.json()
#print(JSON)
if JSON.get('requested_username') and JSON.get('status_code') == 'OK':
with open('Found.txt', "a+") as file_save:
file_save.write(user + '\n')
print('available ->', user)
sleep(1)
else:
print('not available ->', user)
sleep(1)
print('''
''')