I'm using iPython from the Anaconda distribution and I want to know how to check the version of some of the libraries from Terminal (using Mac), for example scikit_learn, but don't know the commands...
could someone advise? Thanks!
For example, opening the terminal with Python 3.8 can (surely will) give a different version of a library than opening with Python 3.5 or Python 2.7. Note 2: We avoid using the print function, because its behavior depends on Python 2 or Python 3. We do not need it, and the terminal will show the value of the expression.
How to Check Python Version in Linux. Most modern Linux distributions come with Python pre-installed. To check the version installed, open a terminal window and entering the following: python ––version.
You can simply check the version, as we do with other software packages to check if a software package is installed properly or not. Type in your terminal. It'll print the version if ipython is installed properly. Show activity on this post.
Modules in the standard library do not have individual versions, but follow the Python version. Check with pip command: pip list, pip freeze, pip show. If you are using the Python package management system pip, you can check the information of the installed package with the following command. Execute commands at the command prompt or terminal.
With anaconda, you can find information about the version with the following command:
conda list <package name>
for instance:
conda list scipy
will return (on my system, from my default environment)
# packages in environment at /Users/reblochonmasque/anaconda3:
#
scipy 0.15.1 np19py34_0
for your specific question, use:
conda list scikit-learn
To find what versions are available for your system, use:
conda info scikit-learn
if you find that you need to update the library, first update conda
conda update conda
then, updating anaconda will update all your libraries (those installed by conda)
conda update anaconda
if you only want to update this specific library (but you may have to deal with dependencies)
conda update -n <environment name> scikit_learn
If you ever need to revert to a previous version: first find out the history of the versions you updated to
conda list -r scikit-learn
then choose the revision you want to revert to (the number will be from the list given by the command above):
conda install --revision=4 scikit-learn
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With