命令行下查看python和numpy的版本和安装位置:
C:\Users\Rnanprince>python -V
Python 3.7.3
C:\Users\Rnanprince>python --version
Python 3.7.3
注意:‘--version'中有两个‘-’
方法一:
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
以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
C:\Users\Rnanprince>python -c "import scipy; print(scipy.__file__)"
D:\Program Files\Anaconda3\lib\site-packages\scipy\__init__.py