VOOZH about

URL: https://www.digitalocean.com/community/tutorials/how-to-install-python-3-and-set-up-a-local-programming-environment-on-macos?comment=71590

⇱ How To Install Python 3 and Set Up a Local Programming Environment on macOS | DigitalOcean


How To Install Python 3 and Set Up a Local Programming Environment on macOS

Updated on July 12, 2022
πŸ‘ How To Install Python 3 and Set Up a Local Programming Environment on macOS

Introduction

Python is a versatile programming language that can be used for many different programming projects. First published in 1991 with a name inspired by the British comedy group Monty Python, the development team wanted to make Python a language that was fun to use. Easy to set up, and written in a relatively straightforward style with immediate feedback on errors, Python is a great choice for beginners and experienced developers alike. Python 3 is the most current version of the language and is considered to be the future of Python.

This tutorial will guide you through installing Python 3 on your local macOS machine and setting up a programming environment via the command line.

Thanks for learning with the DigitalOcean Community. Check out our offerings for compute, storage, networking, and managed databases.

Learn more about our products

About the author

Community and Developer Education expert. Former Senior Manager, Community at DigitalOcean. Focused on topics including Ubuntu 22.04, Ubuntu 20.04, Python, Django, and more.

Still looking for an answer?

Was this helpful?

This textbox defaults to using Markdown to format your answer.

You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

Hi Lisa - thanks for penning this clean documentation.

I ran into one issue though. When i install β€œbrew install python3” - for some reason I am getting python 3.5.2 instead of 3.6.3.

See https://stackoverflow.com/questions/44232913/why-cant-i-install-python-3-6-with-homebrew

Any suggestions?

source my_env/bin/activate

It is not compatible with fish or other type of shell. If you is under fish, use:

source my_env/bin/activate.fish

thanks for the tutorial. how would i run python3 via a web page locally on my computer? i have it working with the shebang line #!/usr/bin/python but if i try to change it to #!/usr/bin/python3 i get an internal server error. is there a way of running a form that calls a python3 script in my_env? i need to have it import some python modules too. thanks.

Thank you for this. Nice and clean. Would you be able to point me to other tutorials which would talk about the order to install Miniconda, Jupyter, and other machine learning related tools? The order and general organization and aliasing for 2.7 and 3 would be appreciated.

Thank you Lisa. Your article helped answer so many questions I had for some time now. I appreciate the time you took to deliver a tutorial on how to set up a Python environment on macOS.

πŸ‘ Creative Commons
This work is licensed under a Creative Commons Attribution-NonCommercial- ShareAlike 4.0 International License.
  • Deploy on DigitalOcean

    Click below to sign up for DigitalOcean's virtual machines, Databases, and AIML products.

Become a contributor for community

Get paid to write technical tutorials and select a tech-focused charity to receive a matching donation.

DigitalOcean Documentation

Full documentation for every DigitalOcean product.

Resources for startups and AI-native businesses

The Wave has everything you need to know about building a business, from raising funding to marketing your product.

Get our newsletter

Stay up to date by signing up for DigitalOcean’s Infrastructure as a Newsletter.

New accounts only. By submitting your email you agree to our Privacy Policy

The developer cloud

Scale up as you grow β€” whether you're running one virtual machine or ten thousand.

Start building today

From GPU-powered inference and Kubernetes to managed databases and storage, get everything you need to build, scale, and deploy intelligent applications.

Β© 2026 DigitalOcean, LLC.Sitemap.
Dark mode is coming soon.