Snake

Python cheatsheet

Generate python requirements.txt from venv

pip freeze > requirements.txt
pip freeze | sed s/=.*// > packages.txt

# or for conda

conda list --export > requirements.txt

# and install all dependencies based on the specified
# requirements

pip install -r ./requirements.txt

conda venv

#for ubuntu
wget -P /tmp https://repo.anaconda.com/archive/Anaconda3-2020.02-Linux-x86_64.sh

git clone somerepo projectname
cd projectname
conda create -n projectname python==3.8
source activate projectname
pip install -r requirements.txt
pip install -e .

python venv

sudo apt install python3.8-venv
python3 -m venv ./venv
source venv/bin/activate

load settings from file here

pip install python-dotenv
from dotenv import load_dotenv
load_dotenv()
API_KEY=os.getenv("API_KEY")

find out installed version

pip freeze | grep numpy

pandas cheat sheet here

tool to download from gdrive