Differences
This shows you the differences between two versions of the page.
linux_wiki:python [2018/07/06 07:03] billdozor [Pip Commands] |
linux_wiki:python [2019/05/25 23:50] |
||
---|---|---|---|
Line 1: | Line 1: | ||
- | ====== Python ====== | ||
- | |||
- | **General Information** | ||
- | |||
- | Administration of Python environments. | ||
- | |||
- | **Checklist** | ||
- | * Distro(s): Enterprise Linux 6/7 | ||
- | |||
- | ---- | ||
- | |||
- | ===== Python Versions ===== | ||
- | |||
- | ^ OS ^ System Package | ||
- | | CentOS 6.x | 2.6.6 | 3.4 | 2.7, 3.3, 3.4 | | ||
- | | CentOS 7.x | 2.7 | 3.4, 3.6 | 2.7, 3.3, 3.4, 3.5 | | ||
- | |||
- | * To avoid breaking system packages(ie yum uses python), let system packaged python versions stay maintained by the official repos. | ||
- | * Use EPEL/ | ||
- | |||
- | ---- | ||
- | |||
- | ====== Python3 Install: EPEL ====== | ||
- | |||
- | To install python 3.4 from the EPEL | ||
- | * 3.4<code bash>yum install python34</ | ||
- | * 3.6<code bash>yum install python36</ | ||
- | |||
- | ---- | ||
- | |||
- | ====== Python3 Install: Software Collections ====== | ||
- | |||
- | Software Collections allow for environments such as newer Python versions to be installed via repos and not conflict with the default system version. | ||
- | |||
- | [[linux_wiki: | ||
- | |||
- | ---- | ||
- | |||
- | ====== Pip ====== | ||
- | |||
- | Pip is a Python package management tool to install modules. | ||
- | |||
- | ===== Install Pip ===== | ||
- | |||
- | Install Pip into a Python environment | ||
- | * Python2< | ||
- | python get-pip.py</ | ||
- | * Python3< | ||
- | python3.6 get-pip.py</ | ||
- | |||
- | \\ | ||
- | Install devel packages that many pip builds rely upon | ||
- | * Python2< | ||
- | * Python3.4< | ||
- | * Python3.6< | ||
- | ===== Pip Commands ===== | ||
- | |||
- | **Python 2 vs Python 3 pip commands** | ||
- | * **Python 2**<code bash>pip < | ||
- | * **Python 3**<code bash> | ||
- | |||
- | \\ | ||
- | List installed python modules | ||
- | <code bash> | ||
- | pip list | ||
- | </ | ||
- | |||
- | \\ | ||
- | Show details about a Python module | ||
- | <code bash> | ||
- | pip show virtualenv | ||
- | </ | ||
- | |||
- | \\ | ||
- | Search for a Python module | ||
- | <code bash> | ||
- | pip search " | ||
- | </ | ||
- | |||
- | \\ | ||
- | Install a Python module | ||
- | <code bash> | ||
- | pip install virtualenv | ||
- | </ | ||
- | |||
- | \\ | ||
- | Upgrade a Python module | ||
- | <code bash> | ||
- | pip install --upgrade scipy | ||
- | </ | ||
- | |||
- | \\ | ||
- | Upgrade pip | ||
- | <code bash> | ||
- | pip install --upgrade pip | ||
- | </ | ||
- | |||
- | \\ | ||
- | Uninstall | ||
- | <code bash> | ||
- | pip uninstall virtualenv | ||
- | </ | ||
- | |||
- | ---- | ||
- | |||
- | ===== Pip Config ===== | ||
- | |||
- | There is a global config file and per user config file locations. | ||
- | |||
- | \\ | ||
- | **Global pip config file** - example to format columns for all users< | ||
- | [list] | ||
- | format=columns | ||
- | </ | ||
- | |||
- | \\ | ||
- | **User pip config file** - for additional config or to over ride the global | ||
- | * Create the pip config directory< | ||
- | * Create the pip.conf file and populate it<code bash>vim ~/ | ||
- | |||
- | #your config here</ | ||
- | |||
- | ---- | ||