python基础.查看第三方的版本和路径

1、查看python及其第三方库的版本和安装位置 - Niuniuaba - 博客园.html(https://www.cnblogs.com/wfsh-hebau/p/10009574.html

2、我的测试代码:

E:\CaiPiao_01\ShuangSeQiu_01\LotteryPredict-master>set path="C:\Python\Python37\Scripts\";"C:\Python\Python37\";%path%

E:\CaiPiao_01\ShuangSeQiu_01\LotteryPredict-master>python
Python 3.7.4 (tags/v3.7.4:e09359112e, Jul  8 2019, 20:34:20) [MSC v.1916 64 bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> import numpy
>>> numpy.__version__#     ZC: 这是直接显示的
'1.16.4'
>>> import jupyter
>>> jupyter.__version__
'1.0.0'
>>> import tensorflow as tf
>>> print(tf.__version__)# ZC: 这是打印出来的信息
1.13.1
>>> print(tf.__file__)
C:\Python\Python37\lib\site-packages\tensorflow\__init__.py
>>> exit()

E:\CaiPiao_01\ShuangSeQiu_01\LotteryPredict-master>python -c "import sys; print(sys.executable)"# ZC: 注意,这里有个"-c" ! ! ! ! ! !
C:\Python\Python37\python.exe# ZC: 打印Python安装位置(1)

E:\CaiPiao_01\ShuangSeQiu_01\LotteryPredict-master>python -c "import os; path = os.sys.executable;folder=path[0 : path.rfind(os.sep)]; print(folder)"
C:\Python\Python37#            ZC: 打印Python安装位置(2)

E:\CaiPiao_01\ShuangSeQiu_01\LotteryPredict-master>python -V#        ZC: 注意是大写的字母"V"
Python 3.7.4

E:\CaiPiao_01\ShuangSeQiu_01\LotteryPredict-master>python --version# ZC: 注意,有2个横杠'-'
Python 3.7.4

E:\CaiPiao_01\ShuangSeQiu_01\LotteryPredict-master>

 

3、

4、

5、

 

posted @ 2020-02-15 20:34  pythonz  阅读(551)  评论(0编辑  收藏  举报