The same approach without WSL works on MacOS
Refer to the Appendix section for detailed installation and setup instructions for WSL, Docker, Homebrew, and more.
Pipenv is a tool for managing Python dependencies, virtual environments, and packaging. It is an alternative to virtualenv and venv, offering a streamlined experience.
sudo apt update
sudo apt install pipenvTo initialize a new environment and install dependencies:
pipenv --python 3.11.9
pipenv install fastapiThis will create a Pipfile and Pipfile.lock, managing dependencies.
pipenv install requests==1.2 --categories="for-Test for-Packaging"
pipenv install numpy --categories="for-ML"pipenv graphpipenv uninstall requests --categories="for-Test"from fastapi import FastAPI
app = FastAPI()
@app.get("/")
def first_example():
"""
First FastAPI Example
"""
return {"Example": "FastAPI"}[[source]]
url = "https://pypi.org/simple"
verify_ssl = true
name = "pypi"
[packages]
fastapi = "*"
[dev-packages]
flask = "*"
[requires]
python_version = "3.11"
python_full_version = "3.11.9"
[for-test]
uvicorn = "*"
flask = "*"
requests = "1.2"
[for-packaging]
uvicorn = "*"
fastapi = "*"
[for-ML]
numpy = "*"pipenv run uvicorn src.app:app --reloadbrew update
brew install pyenvpyenv install 3.11
pyenv shell 3.11
python --versionsudo apt install libsqlite3-dev python3-tk
brew install python-tkpyenv exec pip install virtualenv
virtualenv ~/venvs4py/ve4_ms_abc
source ~/venvs4py/ve4_ms_abc/bin/activatesudo apt install docker.io
sudo systemctl start docker
sudo systemctl enable dockerversion: '3'
services:
example.org:
image: flashspys/nginx-static
container_name: example.org
ports:
- 8081:80
volumes:
- ./path2serve:/staticdocker compose up -dcurl -v http://localhost:8081docker compose downsudo apt install kali-win-kexkex --win -swsl --installThis installs the default Linux distribution (Ubuntu). To install Kali Linux specifically, use:
wsl --install -d kali-linuxwsl -l -vwsl --set-version kali-linux 2wsl --updatewsl/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"echo 'eval "$('/home/linuxbrew/.linuxbrew/bin/brew shellenv')"' >> ~/.bashrc
source ~/.bashrcbrew --version/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"echo 'eval "$('/opt/homebrew/bin/brew shellenv')"' >> ~/.zshrc
source ~/.zshrcbrew --versiondocker versionIf the client connects successfully, it should display version details.
export DOCKER_HOST=tcp://localhost:2375To make this permanent, add it to your ~/.bashrc:
echo 'export DOCKER_HOST=tcp://localhost:2375' >> ~/.bashrc
source ~/.bashrcdocker run hello-worldTo execution logs for troubleshoot help here...