<div dir="ltr">Let me recommend Docker.  You can use the Python base image, to select your preferred Python version, and then run pip or pip3 (as appropriate) in the Dockerfile.  This way installed dependencies are neatly encapsulated, they do not pollute your host environment, and you have documentation of how the Python environment is configured.<div><br></div><div>I demonstrate this in a blog post about OpenADR development using OpenLEADR:</div><div><a href="https://techsparx.com/energy-system/openadr/openleadr-docker.html">https://techsparx.com/energy-system/openadr/openleadr-docker.html</a><br></div><div><br></div><div>A simplified Dockerfile would be:</div><div><br></div><div>FROM python:3<br>VOLUME /setup<br>VOLUME /app<br>RUN apt-get update && \<br>        apt-get upgrade -y && \<br>        apt-get install -y build-essential curl locales<br>COPY requirements.txt /setup/requirements.txt<br>RUN pip3 install -r /setup/requirements.txt<br>python3 /app/app.py<br></div><div><br></div><div><br></div><div>Then, to build it</div><div><br></div><div>docker build --tag your-name/your-application-name:latest .<br></div><div><br></div><div>Then it can be launched using a Docker Compose file</div><div><br></div><div>services:<br>  app:<br>    image: your-name/your-application-name:latest<br>    volumes:<br>      - ./app-source-directory:/app/<br>    networks:<br>      - adrnet<br>    environment:<br>      - PYTHONPATH=... other directories ...:/app<br>    ports:<br>      - 8080:8080<br></div><div><br></div><div><br></div><div>And executed with the command:</div><div><br></div><div>docker compose up</div><div><br></div><div>On your terminal will be logging output.  You can install more services like databases in the Docker Compose file and manage them all this way.  The source code is dynamically mounted into the running container.  That means you can edit as you wish.  My blog post demonstrates using Nodemon to watch the source directory and to automatically restart Python if files change.</div><div><br></div><div>+ David Herron</div><div> </div><div><br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Tue, Dec 6, 2022 at 6:53 AM Thomas Gederberg <<a href="mailto:tgederberg@sbcglobal.net">tgederberg@sbcglobal.net</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div><span style="font-size:14px">It appears that you can either install Python modules (py310-matplotlib, py310-numpy, etc) either directly from MacPorts or you can install pip (for example py30-pip) with MacPorts and then use pip to install the modules.</span><div><span style="font-size:14px"><br></span></div><div><span style="font-size:14px">Is there a recommendation on which way to go?</span></div><div><span style="font-size:14px"><br></span></div><div><span style="font-size:14px">Tom Gederberg</span></div></div></blockquote></div>