2captcha-python icon indicating copy to clipboard operation
2captcha-python copied to clipboard

'TwoCaptcha' object has no attribute 'normal'

Open MaxMady opened this issue 3 years ago • 5 comments

Anyone help me?

from twocaptcha import TwoCaptcha

MaxMady avatar Apr 01 '22 13:04 MaxMady

Probably you have another module with the same name installed.

Do the following:

import twocaptcha
print(twocaptcha.__version__)
print(dir(twocaptcha.TwoCaptcha))

and then show me the output please.

2captcha avatar Apr 05 '22 08:04 2captcha

Hi, i am facing the same issue as well. Apparently, though "2captcha-python" is installed, each time it tries to run it will try to install the package name "TwoCaptcha". This is why the issue is being shown.

I faced this issue before on other packages like "websocket and websocket-client" and its very frustrating as there is a conflicting naming of package.

I tried doing the following but it still does not work as it still tries to install "TwoCaptcha" everytime i run the code. By the way, I am using replit to do it.

pip3 install 2captcha-python pip3 uninstall TwoCaptcha

import sys
from twocaptcha import TwoCaptcha



try:
    solver = TwoCaptcha("<api key here>")
    result = solver.normal("hello.jpg")
    print(result)

except Exception as e:
    sys.exit(e)

else:
    sys.exit('solved: ' + str(result))

Chan0920 avatar Apr 22 '22 06:04 Chan0920

I'm having the same issue, mind ask how this is solved? So I uninstalled TwoCaptcha and installed captcha-python but this is what I get

from twocaptcha import TwoCaptcha ImportError: cannot import name 'TwoCaptcha' from 'twocaptcha' (unknown location)

This is my code

from twocaptcha import TwoCaptcha

import twocaptcha

print(twocaptcha.__version__)

print(dir(twocaptcha.TwoCaptcha))

jeff41101 avatar Jul 06 '22 11:07 jeff41101

Hello this worked for me, following the steps of this in Pypi https://pypi.org/project/2captcha-python/#installation

pip3 install 2captcha-python

from twocaptcha import TwoCaptcha
solver = TwoCaptcha(key_captcha)        
result = solver.normal(file=...)

githubpaycon avatar Aug 11 '22 14:08 githubpaycon

I tried to resolve click captchas on 2captcha website and via python, but both got timeout or error captcha unsolvable.. any fix? i'm using jpg screenshot of the captcha

Soif2Sang avatar Aug 12 '22 18:08 Soif2Sang