2captcha / 2captcha-python

Python 3 package for easy integration with the API of 2captcha captcha solving service to bypass recaptcha, hcaptcha, funcaptcha, geetest and solve any other captchas.
https://2captcha.com
MIT License
495 stars 93 forks source link

import error follow on document example #58

Closed ChiHangChen closed 1 year ago

ChiHangChen commented 1 year ago

I follow the document using this line

from twocaptcha import TwoCaptcha

But it will throw an error ImportError: cannot import name 'TwoCaptcha' from 'twocaptcha' (unknown location

Shouldn't it be

from twocaptcha.solver import TwoCaptcha

in document?

I am using 1.2.1 version

kratzky commented 1 year ago

No, I don't think so. It works the way it's described in the doc.

image

Probably you have another module installed that has twocaptcha namespace.

ChiHangChen commented 1 year ago

You probably right, I have another lib TwoCaptcha==0.0.1 After remove it and can import as document decription, But I think

from twocaptcha import TwoCaptcha

and

from twocaptcha.solver import TwoCaptcha

Both work for 2captcha-python==1.2.1