Python pip(管理模組工具)基礎用法
Python 自帶了一個 pip 工具用來檢視、管理所安裝的各種模組。
檢視已安裝的模組
檢視已安裝的模組,使用如下命令:
pip show packagename
啟動命令列視窗,在視窗中輸入如下命令:
pip show mysql-connector-python
在上面的命令中,mysql-connector-python 就是該模組的名字。執行該命令,可以看到如下輸出結果:
Name: mysql-connector-python Version: 8.0.11 Summary: MySQL driver written in Python Home-page: http://dev.mysql.com/doc/connector-python/en/index.html Author: Oracle and/or its affiliates Author-email: UNKNOWN License: GNU GPLv2 (with FOSS License Exception) Location: d:pythonpython36libsite-packages Requires: protobuf Required-by:
從上面的輸出結果可以看到,已經成功安裝了 mysql-connector-python 8.0.11,以及該模組的官方網址和安裝路徑等有用的資訊。
解除安裝己安裝的模組
解除安裝己安裝的模組,使用如下命令:
pip uninstall packagename
在命令列視窗中輸入如下命令:
pip uninstall mysql-connector-python
執行該命令,可以看到如下輸出結果:
Uninstalling mysql-connector-python 8.0.11: Would remove: d:pythonpython36libsite-packagesmysql d:pythonpython36libsite-packagesmysql_connector_python-8.0.11-py3.6.egg-info d:pythonpython36libsite-packagesmysqlx Proceed (y/n)?
上面的提示資訊詢問是否要刪除 mysql-connector-python 模組,如果刪除該模組,將會刪除 3 個目錄。如果希望刪除,則可以在輸入“y”之後按Enter鍵。接下來將看到系統提示如下資訊:
Successfully uninstalled mysql connector-python-8.0.11
該資訊顯示 mysql-connector-python-8.0.11 被刪除成功。 執行該刪除命令後,Python 將不再包含 mysql-connector-python 模組,相當於在安裝 MySQL 伺服器時沒有選擇 Connector/Python 模組。 如果要檢視已安裝的所有模組,可以使用如下命令: 安裝模組 安裝模組,使用如下命令: 在命令列視窗中輸入如下命令:pip list
pip install packagename
pip install mysql-connectar-python
執行該命令,將看到程式下載並安裝 mysql-connector-python 模組的過程,最後會生成如下提示資訊:
Successfully installed mysql-connector-python-8.0.11
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/3137/viewspace-2837318/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- Python基礎——模組Python
- Python基礎之模組Python
- Python基礎12(模組與datetime模組)Python
- python 基礎之模組與包Python
- python基礎學習16—-模組Python
- python 基礎筆記——常用模組Python筆記
- Python基礎:常用系統模組Python
- 【python基礎】os模組的使用Python
- 豬行天下之Python基礎——1.2 pip包管理工具 & 虛擬環境Python
- Python基礎(九) 常用模組彙總Python
- Python基礎入門(8)- Python模組和包Python
- Python中常用模組有哪些?Python基礎教程Python
- Python中paramiko 模組的用法Python
- Python中operator 模組的用法Python
- Python中pathlib 模組的用法Python
- Python中itertools 模組的用法Python
- python(pip)包/模組:如何離線安裝?Python
- ansible基礎-模組
- python基礎之-sys模組、os模組基本介紹(未完成)Python
- mac python 包管理工具 pip 的配置MacPython
- 豬行天下之Python基礎——10.2 Python常用模組(下)Python
- 豬行天下之Python基礎——10.1 Python常用模組(上)Python
- python基礎--自定義模組、import、from......import......PythonImport
- Python基礎(八) 模組的引入與定義Python
- Python 庫/模組的pip安裝和IPython的使用Python
- Python模組以及日曆常見用法Python
- 前端模組化基礎前端
- Python包和模組管理Python
- 豬行天下之Python基礎——2.1 Python註釋與模組Python
- python基礎 之 正規表示式和re模組Python
- Python基礎_元組Python
- pip 命令安裝模組包
- pip進行模組安裝
- pip高階玩法,讓python模組安裝飛起來Python
- python常識系列08-->logging模組基礎入門Python
- Python 基礎 3 - 元組Python
- Python基礎(05):元組Python
- nodejs request模組用法NodeJS