Skip to content

Instantly share code, notes, and snippets.

@lcenchew
Last active October 20, 2023 10:03
Show Gist options
  • Save lcenchew/968e6c6973afd2fc1f4c8882cefe1adb to your computer and use it in GitHub Desktop.
Save lcenchew/968e6c6973afd2fc1f4c8882cefe1adb to your computer and use it in GitHub Desktop.
Notes - Python #notes

Python

macOS

https://docs.python.org/3/using/mac.html

No python, only python3 in Ventura and newer.

the very basic

brew install python
brew postinstall python3
pip3 install virtualenv virtualenvwrapper

virtualenv -p python3 env_name
source env_name/bin/activate

deactivate

create venv (python3)

python3 -m venv .venv
source ./venv/bin/activate

Add to ~/.zshrc:

plugins=(virtualenv)

Edit ~/.oh-my-zsh/themes/robbyrussell.zsh-theme Add after PROMPT=

PROMPT+='%{$fg[green]%}$(virtualenv_prompt_info)%{$reset_color%}%'
exit()

Windows

.venv\Scripts\activate.bat

Working with VS Code


🔼

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment