我的Bitbucket帐户没有启用2FA,但当我尝试访问我的任何存储库时,我收到错误from PIL import Image
from matplotlib import pyplot as plt
import numpy as np
import time
from collections import Counter
np.seterr(over='ignore')
def createExamples():
numberArrayExamples=open('numArEx.txt','a')
numbersWeHave=range(1,3)
versionsWeHave=range(1,10)
for eachNum in numbersWeHave:
for eachVer in versionsWeHave:
#print str(eachNum)+'.'+str(eachVer)
imgFilePath = 'images/'+str(eachNum)+'.'+str(eachVer)+'.jpg'
ei=Image.open(open(imgFilePath,'rb'))
eiar=np.array(ei)
eiar1=str(eiar.tolist())
lineToWrite=str(eachNum)+'::'+eiar1+'\n'
numberArrayExamples.write(lineToWrite)
def threshold(imageArray):
balanceAr = []
newAr = imageArray
for eachRow in imageArray:
for eachPix in eachRow:
avgNum = reduce(lambda x, y: x + y, eachPix[:3]) / eachPix[:3])
balanceAr.append(avgNum)
balance = reduce(lambda x, y: x + y, balanceAr) / len(balanceAr)
for eachRow in newAr:
for eachPix in eachRow:
if reduce(lambda x, y: x + y, eachPix[:3]) / eachPix[:3]) > balance:
eachPix[0] = 255
eachPix[1] = 255
eachPix[2] = 255
else:
eachPix[0] = 0
eachPix[1] = 0
eachPix[2] = 0
return newAr
def whatNumIsThis(filePath):
matchedAr=[]
loadExamps=open('numArEx.txt','r').read()
loadExamps=loadExamps.split('\n')
i=Image.open(open(filePath,'rb'))
iar=np.array(i)
iar1=iar.tolist()
inQuestion=str(iar1)
for eachExample in loadExamps:
try:
splitEx=eachExample.split('::')
currentNum=splitEx[0]
currentAr=splitEx[1]
eachPixEx = currentAr.split(']')
eachPixInQ=inQuestion.split(']')
x=0
while x<len(eachPixEx):
if eachPixEx[x]==eachPixInQ[x]:
matchedAr.append(int(currentNum))
x+=1
except Exception as e:
print(str(e))
print matchedAr
x=Counter(matchedAr)
print (x)
print (x[0])
whatNumIsThis('images/teste.jpg')
我甚至创建了一个全新的帐户,我没有进行两步验证。我仍然得到同样的错误,为什么以及解决方案是什么?
答案 0 :(得分:1)
检查您的credential helper:它可能已缓存基于2FA的凭据。
git config credential.helper
如果已存储bitbucket.org
的凭据,则可以解释为什么新帐户仍会受到该问题的影响。