python 查看某个库的版本
时间: 2023-10-27 08:06:37 浏览: 305
python看某个模块的版本方法
5星 · 资源好评率100%
可以使用 `pip show` 命令查看某个库的版本,具体操作如下:
1. 打开终端或命令行窗口;
2. 输入以下命令,将 `library_name` 替换为需要查看版本的库名:
```
pip show library_name
```
3. 按下回车键,终端会显示该库的版本信息。
例如,如果要查看 `numpy` 库的版本,可以输入以下命令:
```
pip show numpy
```
终端会显示类似以下的版本信息:
```
Name: numpy
Version: 1.19.5
Summary: NumPy is the fundamental package for array computing with Python.
Home-page: https://www.numpy.org
Author: Travis E. Oliphant et al.
Author-email: None
License: BSD
Location: /usr/local/lib/python3.7/site-packages
Requires:
Required-by: pandas, opencv-python, matplotlib, Keras, imageio, tensorflow, seaborn, scipy, scikit-learn, pillow, opencv-python-headless, opencv-contrib-python-headless, mxnet, mkl-random, mkl-fft, lightgbm, librosa, Keras-Preprocessing, Keras-Applications, h5py, gym, gensim, folium, featuretools, faiss-gpu, dlib, cupy-cuda101, cupy-cuda100, cupy-cuda92, cupy-cuda91, chainer, astropy
```
其中 `Version` 行显示了 `numpy` 库的版本号。
阅读全文