Skip to content

Instantly share code, notes, and snippets.

@roymanigley
Last active March 13, 2022 00:38
Show Gist options
  • Save roymanigley/e703b399acc48e44c8e13c3f18980566 to your computer and use it in GitHub Desktop.
Save roymanigley/e703b399acc48e44c8e13c3f18980566 to your computer and use it in GitHub Desktop.
initializes a python3 project with venv and git
#!/bin/bash
# wget https://gist.githubusercontent.com/roymanigley/e703b399acc48e44c8e13c3f18980566/raw/fce917f57ccadc5570de9b1b025ab1d6a988580a/init-jupyter-notebook.sh -O init-jupyter-notebook.sh && source init-jupyter-notebook.sh
if [ ! -d .venv ]
then
python3 -m venv .venv && \
source .venv/bin/activate && \
pip install --upgrade pip && \
pip install notebook matplotlib numpy pandas seaborn folium sklearn requests && \
pip freeze > requirements.txt
echo .venv > .gitignore && \
git init && git add . && git commit -m"initial commit"
else
source .venv/bin/activate && \
pip install -r requirements.txt
fi
mkdir notebooks -p && \
jupyter notebook notebooks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment