close

how to check which version of nltk, scikit learn installed?

Hello Guys, How are you all? Hope You all Are Fine. Today We Are Going To learn about how to check which version of nltk, scikit learn installed in Python. So Here I am Explain to you all the possible Methods here.

Without wasting your time, Let’s start This Article.

Table of Contents

how to check which version of nltk, scikit learn installed?

  1. how to check which version of nltk, scikit learn installed?

    Note that not all Python packages are guaranteed to have a __version__ attribute, so for some others it may fail, but for nltk and scikit-learn at least it will work.

  2. check which version of nltk, scikit learn installed

    Note that not all Python packages are guaranteed to have a __version__ attribute, so for some others it may fail, but for nltk and scikit-learn at least it will work.

Method 1

import nltk is Python syntax, and as such won’t work in a shell script.

To test the version of nltk and scikit_learn, you can write a Python script and run it. Such a script may look like

import nltk
import sklearn

print('The nltk version is {}.'.format(nltk.__version__))
print('The scikit-learn version is {}.'.format(sklearn.__version__))

# The nltk version is 3.0.0.
# The scikit-learn version is 0.15.2.

Note that not all Python packages are guaranteed to have a __version__ attribute, so for some others it may fail, but for nltk and scikit-learn at least it will work.

Method 2

Try this:

$ python -c "import nltk; print nltk.__version__"

Conclusion

It’s all About this issue. Hope all Methods helped you a lot. Comment below Your thoughts and your queries. Also, Comment below which Method worked for you? Thank You.

Also, Read