How do I check which version of NumPy I'm using?

后端 未结 16 949
深忆病人
深忆病人 2020-12-07 08:48

How can I check which version of NumPy I\'m using?

(FYI this question has been edited because both the question and answer are not platform specific.)

16条回答
  •  佛祖请我去吃肉
    2020-12-07 09:24

    You can get numpy version using Terminal or a Python code.

    In a Terminal (bash) using Ubuntu:

    pip list | grep numpy
    

    In python 3.6.7, this code shows the numpy version:

    import numpy
    print (numpy.version.version)
    

    If you insert this code in the file shownumpy.py, you can compile it:

    python shownumpy.py
    

    or

    python3 shownumpy.py
    

    I've got this output:

    1.16.1
    

提交回复
热议问题