5

Is there a way to check pytesseract version in python?
According to PyPi documentation of pytesseract, there is a built-in function get_tesseract_version to get pytesseract version. But when I run it in python, I get the following:

>>> import pytesseract >>> pytesseract.get_tesseract_version <function get_tesseract_version at 0x7f4b9edd4598> >>> print(pytesseract.get_tesseract_version) <function get_tesseract_version at 0x7f4b9edd4598> 

I know that I can get pytesseract version using pip freeze, but I want to get it using python. Is that possible?

3 Answers 3

10

You need to call the function – pytesseract.get_tesseract_version() – but that will get you the underlying Tesseract version, not the version of pytesseract in use.

Since pytesseract doesn't unfortunately expose the standard __version__ variable, you can use the pkg_resources API to introspect the current package environment:

>>> import pkg_resources >>> pkg_resources.working_set.by_key['pytesseract'].version '0.3.0' 
Sign up to request clarification or add additional context in comments.

1 Comment

Thank you, this answers my question.
6

Just add the function parenthesis and you should get the output:

pytesseract.get_tesseract_version() 5.0.0-alpha.20200328 

1 Comment

If you check the accepted answer "pytesseract.get_tesseract_version() – but that will get you the underlying Tesseract version, not the version of pytesseract in use" it is incorrect
0

If you are working with pip, simply type the following command inside your environment:

pip freeze

All installed packages (in that environment) and their corresponding versions will be listed:)

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.