DevOps Buzz
Search…
Initial page
About me
Ansible
Cheat Sheet
Dynamic inventory
AKS
Cheat Sheet
Autoscale
Backup
Dashboard
Ingress
Node management
News
Persistent Volumes
Arch Linux
Docker
Install
Network
VirtualBox guest
Azure
API
CLI/Powershell
DevOps
Application Gateway
Tools
Sops
AWS
Cheat Sheet
Tools
Cognito with Amplify and React
Bash / Shell
Cheat Sheet
Tools
Bitbucket
Cheat Sheet
CSS
Cheat Sheet
Distros
Manjaro
Docker
Cheat Sheet
ELK
Ubuntu NoVNC
Tools
Known errors and solutions
Elasticsearch
Cheat Sheet
Tools
ELK
Cheat Sheet
emacs
Cheat sheet
Gatekeeper (OPA)
Cheat Sheet
Developer Quick Start
GCP
Cheat Sheet
General
Tools
News
Git
Cheat Sheet
Tools
Golang
Cheat Sheet
Guidelines / Standards
Cheat Sheet
i3wm
Cheat Sheet
Ipsec
Cheat sheet
Istio
Cheat Sheet
Kind
Cheat Sheet
Kops
Cheat Sheet
Kubeadm
Cheat Sheet
Change serviceSubnet CIDR
Setup cluster
Multi master
Known errors and solutions
Kubernetes
Kubectl Cheat Sheet
etcd Cheat Sheet
Tools
News
Deployments
Dashboard
ELK
Helm
Ingress
logz.io
Minikube
Monitoring
Node Management
Operators
Security
Volumes
Networking
kube-controller-manager
Known errors and solutions
Lumen
Cheat Sheet
MACOS
Cheat Sheet
Qemu
Zsh
microk8s
Cheat Sheet
MongoDB
Cheat Sheet
Tools
MySQL
Cheat Sheet
Network
Tools
WDS - Wireless Distribution System
Expose server under NAT
nvim
Cheat Sheet
Openvpn
OpenVPN server on Ubuntu 18.06
Stunnel
PHP
Composer
Prometheus
Tools
Python
Cheat Sheet
Pydantic
Tools / Modules
Virtualenv
RabbitMQ
Cheat Sheet
ReactJS
Fixes
For beginners
Ruby
Cheat Sheet
Rails
rvm
Rundeck
Cheat Sheet
Rust
Cheat Sheet
Squid
Setup server
Expose NAT server
SRE
Cheat Sheet
SSH
Passwordless auth with RSA key
Reverse tunnel
Cheat Sheet
SSL
Cheat Sheet
certbot
STACK SETUP
Using EKS and Gitlab CI to deploy applications
Terraform
Cheat Sheet
Tools
Tmux
Cheat Sheet
Tor
Cheat Sheet
Ubuntu
Cheat Sheet
Vagrant
Cheat Sheet
VirtualBox
Cheat Sheet
Windows
Windows Docker
Fingerprint
SSH Client
Tools
VirtualBox
WSL
Powered By
GitBook
Cheat Sheet
Python tips and tricks.
Definitions / examples
GitHub - gto76/python-cheatsheet: Comprehensive Python Cheatsheet
GitHub
GitHub - geekcomputers/Python: My Python Examples
GitHub
GitHub - vinta/awesome-python: A curated list of awesome Python frameworks, libraries, software and resources
GitHub
​
Install multiple versions
Install all packages.
1
apt
update
2
apt
install
python2.7 python2.7-dev
3
apt
install
python3.5 python3.5-dev
4
apt
install
python3.6 python3.6-dev
Copied!
Update alternatives for python (2).
1
sudo
update-alternatives --install /usr/bin/python python /usr/bin/python2.7
1
2
sudo
update-alternatives --install /usr/bin/python python /usr/bin/python3.5
2
3
sudo
update-alternatives --install /usr/bin/python python /usr/bin/python3.6
3
4
sudo
update-alternatives --config python
Copied!
Select python2.7
Update alternatives for python3.
1
sudo
update-alternatives --install /usr/bin/python3 python3 /usr/bin/python3.5
1
2
sudo
update-alternatives --install /usr/bin/python3 python3 /usr/bin/python3.6
2
3
sudo
update-alternatives --config python3
Copied!
Select python3.6
Fix pip.
1
sudo
pip
install
pip --upgrade
2
sudo
python3 -m pip uninstall pip
3
sudo
apt
install
python3-pip --reinstall
4
wget
https://bootstrap.pypa.io/get-pip.py
5
sudo
python3.6 get-pip.py
Copied!
​
Import module from parent dir
1
script_path
=
os.path.dirname
(
os.path.realpath
(
__file__
))
2
root_path
=
f
"{script_path}/../../../"
3
sys.path.insert
(
0
, root_path
)
4
from mymodule
import
myfile
Copied!
Prometheus - Previous
Tools
Next - Python
Pydantic
Last modified
1yr ago
Copy link
Contents
Definitions / examples
Install multiple versions
Import module from parent dir