Skip to content

Latest commit

 

History

History
50 lines (42 loc) · 1 KB

python.md

File metadata and controls

50 lines (42 loc) · 1 KB

My Cheat-sheets

<style> a {font-size:1.5em} </style>

Python-Sheet

My Python cheat-sheet

Pipenv

To have Pipenv create .venv in project directory
export PIPENV_VENV_IN_PROJECT=1
May be done in ~/.bashrc.

Virtual Environment

Install the package
sudo apt install virtualenv

Create the virtualenv in the projects directory(optional specify py-version)

cd /home/stoo/myPyProject
virtualenv -p python3 venv

Source the newly created venv
source venv/bin/activate[.fish]

Install any desired python package in the venv
(venv)pip install MyPyPackage

Export all installed packages to a file
(venv)pip freeze > requirements.txt

Install packages from file
pip install -r requirements.txt