命令行下查看python和numpy的版本和安装位置:
1、查看python版本
C:\Users\Rnanprince>python -V
Python 3.7.3
C:\Users\Rnanprince>python --version
Python 3.7.3
注意:‘--version'中有两个‘-’
2、查看python安装位置
方法一:
C:\Users\Rnanprince>python -c "import sys; print(sys.executable)"
D:\Program Files\Anaconda3\python.exe
方法二:
C:\Users\Rnanprince>python -c "import os; print(os.sys.executable)"
D:\Program Files\Anaconda3\python.exe
3、查看包版本
以Scipy为例:
方法一:
C:\Users\Rnanprince>python -c "import scipy; print(scipy.version.version)"
1.2.1
方法二:
C:\Users\Rnanprince>python -c "import scipy; print(scipy.__version__)"
1.2.1
4、查看包的安装路径
C:\Users\Rnanprince>python -c "import scipy; print(scipy.__file__)"
D:\Program Files\Anaconda3\lib\site-packages\scipy\__init__.py