- Type
python3
in Terminal to start - Type
quit()
orexit()
to exit
- Type
python
in CMD to start - Type
quit()
orexit()
to exit
- Mac OS
import os
import sys
os.path.dirname(sys.executable)
OR type where python3
- Windows
import os
import sys
os.path.dirname(sys.executable)
OR type where python
- Windows
pip install virtualenv
virtualenv env --version
# navigate to project folder
cd Documents\GitHub\airflow
# create virtual environment
virtualenv venv_aiflow
# activate virtual environment
cd Documents\airflow\airflow\venv_airflow
python3 -m venv env
source env/bin/activate
python3.8 -m venv dbt_env
source dbt_env/bin/activate
python3 --version
pip install virtualenv
virtualenv --version
# create project folder
cd Documents
mkdir airflow_env
virtualenv airflow_env -p python3
# activate virtual environment
source airflow_env/bin/activate
- you can use
pipx
to installvirtualenv
# install pipx
python3 -m pip install --user pipx
python3 -m pipx ensurepath
pipx completions
# install virtualenv via pipx
pipx install virtualenv
virtualenv --help
- You can install
pip
using
curl https://bootstrap.pypa.io/get-pip.py -o get-pip.py
python get-pip.py
- OR you can install
pip
viahomebrew
- this is recommended as it is likely you'll need
pip
for other installations
- this is recommended as it is likely you'll need
# install homebrew
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
# use brew to install pip and virtualenv
brew install brew-pip
brew install virtualenv
brew install python@3.8
brew install python@3.9
brew install python@3.10
python3 --version
python3.8 --version
python3.9 --version
- https://formulae.brew.sh/formula/python@3.8
- https://formulae.brew.sh/formula/python@3.9
- https://formulae.brew.sh/formula/python@3.10