Differences
This shows you the differences between two versions of the page.
Both sides previous revision Previous revision Next revision | Previous revision | ||
linux_wiki:python [2016/03/28 22:00] billdozor [Software Collections] |
linux_wiki:python [2018/07/06 07:05] billdozor [Pip Config] |
||
---|---|---|---|
Line 12: | Line 12: | ||
===== Python Versions ===== | ===== Python Versions ===== | ||
- | ^ OS ^ System Package | + | ^ OS ^ System Package |
- | | CentOS 6.x | 2.6.6 | 2.7, 3.3 | | + | | CentOS 6.x | 2.6.6 |
- | | CentOS 7.x | 2.7.5 | + | | CentOS 7.x | 2.7 |
- | * To avoid breaking system packages(ie yum uses python), let system packaged | + | * To avoid breaking system packages(ie yum uses python), let system packaged |
- | * Use software collections | + | * Use EPEL/software collections |
---- | ---- | ||
- | ===== Software Collections ===== | + | ====== 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 allow for environments such as newer Python versions to be installed via repos and not conflict with the default system version. | Software Collections allow for environments such as newer Python versions to be installed via repos and not conflict with the default system version. | ||
Line 29: | Line 37: | ||
---- | ---- | ||
- | ===== Pip ===== | + | ====== Pip ====== |
Pip is a Python package management tool to install modules. | Pip is a Python package management tool to install modules. | ||
- | ==== Install Pip ==== | + | ===== Install Pip ===== |
- | <code bash> | + | |
- | wget https:// | + | |
- | python get-pip.py | + | |
- | </ | + | |
- | ==== Pip Commands ==== | + | 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 | List installed python modules | ||
<code bash> | <code bash> | ||
Line 45: | Line 66: | ||
</ | </ | ||
+ | \\ | ||
Show details about a Python module | Show details about a Python module | ||
<code bash> | <code bash> | ||
Line 50: | Line 72: | ||
</ | </ | ||
+ | \\ | ||
Search for a Python module | Search for a Python module | ||
<code bash> | <code bash> | ||
Line 55: | Line 78: | ||
</ | </ | ||
+ | \\ | ||
Install a Python module | Install a Python module | ||
<code bash> | <code bash> | ||
Line 60: | Line 84: | ||
</ | </ | ||
+ | \\ | ||
Upgrade a Python module | Upgrade a Python module | ||
<code bash> | <code bash> | ||
Line 65: | Line 90: | ||
</ | </ | ||
+ | \\ | ||
Upgrade pip | Upgrade pip | ||
<code bash> | <code bash> | ||
Line 70: | Line 96: | ||
</ | </ | ||
+ | \\ | ||
Uninstall | Uninstall | ||
<code bash> | <code bash> | ||
Line 76: | Line 103: | ||
---- | ---- | ||
+ | |||
+ | ===== 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</ | ||
+ | |||
+ | ---- | ||
+ | |||
+ | ====== Python Modules ====== | ||
+ | |||
+ | Some commonly installed Python modules. | ||
+ | |||
+ | ===== Virtualenv ===== | ||
+ | |||
+ | Virtualenv "is a tool to create isolated Python environments." | ||
+ | |||
+ | Site: https:// | ||
+ | |||
+ | * Python2< | ||
+ | * Python3< | ||
+ | |||
+ | ---- | ||
+ | |||
+ | ===== PipEnv ===== | ||
+ | |||
+ | PipEnv " | ||
+ | |||
+ | Site: https:// | ||
+ | |||
+ | * Python2< | ||
+ | * Python3< | ||
+ | |||
+ | ---- | ||
+ | |||
+ | ===== AWS CLI ===== | ||
+ | |||
+ | AWS CLI "is a unified tool to manage your AWS services. With just one tool to download and configure, you can control multiple AWS services from the command line and automate them through scripts." | ||
+ | |||
+ | Site: https:// | ||
+ | |||
+ | Pre-Reqs< | ||
+ | |||
+ | Install | ||
+ | * Python2< | ||
+ | * Python3< | ||
+ | |||
+ | Verify | ||
+ | * Python2 and Python3< | ||
+ | |||
+ | ==== Cert Verify Failed ==== | ||
+ | |||
+ | If you are seeing errors while using the aws cli about "SSL: CERTIFICATE_VERIFY_FAILED" | ||
+ | * Point the aws cli to the system ca bundle (**per user**)< | ||
+ | |||
+ | # AWS CA Bundle | ||
+ | export AWS_CA_BUNDLE="/ | ||
+ | * Source the file< | ||
+ | |||
+ | ---- | ||
+ |