查看python,numpy,scipy,matplotlib的版本及版本更新

查看python,numpy,scipy,matplotlib的版本及版本更新

最近運行一個程序需要更新
matplotlib==1.5.3
numpy==1.11.3
scipy==0.17.0
seaborn==0.7.1
因爲都已經裝過了只是版本不合適,所以只要升級就可以了,直接用 pip install -r requirements.txt 報錯,所以準備一個一個的更新

查看版本

原文在這裏

  • 查看python版本
    方法一:
    python -V 注意:‘-V‘中‘V’爲大寫字母,只有一個‘-’
    方法二:
    python –version 注意:‘–version’中有兩個‘-’
  • 查看python安裝位置
    方法一: 
    python -c “import sys; print sys.executable”
    方法二:
    python -c “import os; print os.sys.executable”
    python -c “import os; path = os.sys.executable;folder=path[0 : path.rfind(os.sep)]; print folder”
  • 查看Numpy版本
    python -c “import numpy; print numpy.version.version”

    python -c “import numpy; print numpy.version
  • 查看Numpy安裝路徑
    python -c “import numpy; print numpy.file

  • 查看SciPy版本
    python -c “import scipy; print scipy.version.version”

    python -c “import scipy; print scipy.version

  • 查看SciPy安裝路徑
    python -c “import scipy; print scipy.file

  • 查看Matplotlib版本
    python -c “import matplotlib; print matplotlib.version.version”

    python -c “import matplotlib; print matplotlib.version
  • 查看Matplotlib安裝路徑
    python -c “import matplotlib; print matplotlib.file

升級包

  • 可以用pip命令:
    pip install -U <包名>
    或: pip install <包名> –upgrade
  • Matplotlib,SciPy在安裝時始終報錯,決定手動下載包安裝(隨便兩個我下過的地址):
  • scipy報錯: error:library dfftpack has Fortran sources but no Fortran compiler found
    • 也有人遇到了這個錯誤:問題鏈接
    • 根據裏面的建議,我最後是用 sudo apt-get install libatlas-base-dev gfortran 後再手動安裝解決的

備註一個“pip常用命令”:

http://www.cnblogs.com/xueweihan/p/4981704.html

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章