<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/"
    xmlns:atom="http://www.w3.org/2005/Atom" xmlns:media="http://search.yahoo.com/mrss/" version="2.0">
    <channel>
        
        <title>
            <![CDATA[ Daniel Kehoe - freeCodeCamp.org ]]>
        </title>
        <description>
            <![CDATA[ Browse thousands of programming tutorials written by experts. Learn Web Development, Data Science, DevOps, Security, and get developer career advice. ]]>
        </description>
        <link>https://www.freecodecamp.org/news/</link>
        <image>
            <url>https://cdn.freecodecamp.org/universal/favicons/favicon.png</url>
            <title>
                <![CDATA[ Daniel Kehoe - freeCodeCamp.org ]]>
            </title>
            <link>https://www.freecodecamp.org/news/</link>
        </image>
        <generator>Eleventy</generator>
        <lastBuildDate>Thu, 14 May 2026 11:46:32 +0000</lastBuildDate>
        <atom:link href="https://www.freecodecamp.org/news/author/DanielKehoe/rss.xml" rel="self" type="application/rss+xml" />
        <ttl>60</ttl>
        
            <item>
                <title>
                    <![CDATA[ How to Install Java on Mac in 2026 ]]>
                </title>
                <description>
                    <![CDATA[ Java is the most widely used programming language for enterprise software, Android development, and university computer science courses. Apple doesn't include Java with macOS, so you need to install i ]]>
                </description>
                <link>https://www.freecodecamp.org/news/how-to-install-java-on-mac/</link>
                <guid isPermaLink="false">69987a933dc17c4862f4c18d</guid>
                
                    <category>
                        <![CDATA[ Java ]]>
                    </category>
                
                    <category>
                        <![CDATA[ macOS ]]>
                    </category>
                
                    <category>
                        <![CDATA[ programming ]]>
                    </category>
                
                    <category>
                        <![CDATA[ Development Tools ]]>
                    </category>
                
                <dc:creator>
                    <![CDATA[ Daniel Kehoe ]]>
                </dc:creator>
                <pubDate>Fri, 20 Feb 2026 15:15:31 +0000</pubDate>
                <media:content url="https://cloudmate-test.s3.us-east-1.amazonaws.com/uploads/covers/5e1e335a7a1d3fcc59028c64/ab23255a-f10d-485b-9fd2-ee247138ed9e.png" medium="image" />
                <content:encoded>
                    <![CDATA[ <p>Java is the most widely used programming language for enterprise software, Android development, and university computer science courses. Apple doesn't include Java with macOS, so you need to install it yourself.</p>
<p>If you search for "install Java on Mac," you'll find a confusing number of vendors, version numbers, and installation methods. To make it easy, I'll cut through the confusion and show you a recommended Java installation path that takes about five minutes.</p>
<p>Here's my recommendation: Install <strong>Java 25</strong> using <strong>Homebrew</strong> with the <strong>Eclipse Temurin</strong> distribution. Java 25 is the current LTS (Long-Term Support) release and your best choice unless your work team or university course uses an older version. With Homebrew, one terminal command accommodates the entire installation. The Temurin distribution is free, certified, and unencumbered by Oracle's licensing restrictions.</p>
<p>Now I’ll walk you through the process.</p>
<h2 id="heading-table-of-contents">Table of Contents</h2>
<ol>
<li><p><a href="#heading-what-you-need-before-you-begin">What You Need Before You Begin</a></p>
</li>
<li><p><a href="#heading-how-to-check-if-java-is-already-installed">How to Check if Java Is Already Installed</a></p>
</li>
<li><p><a href="#heading-why-eclipse-temurin-and-why-not-oracle">Why Eclipse Temurin and Why Not Oracle</a></p>
</li>
<li><p><a href="#heading-how-to-install-java-with-homebrew">How to Install Java with Homebrew</a></p>
</li>
<li><p><a href="#heading-how-to-verify-the-installation">How to Verify the Installation</a></p>
</li>
<li><p><a href="#heading-how-to-set-javahome-for-build-tools">How to Set JAVA_HOME for Build Tools</a></p>
</li>
<li><p><a href="#heading-how-to-troubleshoot-common-problems">How to Troubleshoot Common Problems</a></p>
</li>
<li><p><a href="#heading-alternative-installation-methods">Alternative Installation Methods</a></p>
</li>
<li><p><a href="#heading-whats-next">What's Next</a></p>
</li>
</ol>
<h2 id="heading-what-you-need-before-you-begin">What You Need Before You Begin</h2>
<p>With this recommended path, you only need two things before you install Java: a terminal application and the Homebrew package manager.</p>
<h3 id="heading-terminal">Terminal</h3>
<p>Terminal is the built-in <a href="https://mac.install.guide/terminal/">Mac terminal application</a>. If you don’t know, you can learn <a href="https://mac.install.guide/terminal/open">how to open Terminal here</a>. You'll use it to run the installation commands.</p>
<h3 id="heading-homebrew">Homebrew</h3>
<p>Homebrew is a package manager you can use to install software programs for the command line. Check if you already have it like this:</p>
<pre><code class="language-bash">$ brew --version
Homebrew 5.0.11
</code></pre>
<p>If you see a version number, you're ready. If you see <a href="https://mac.install.guide/homebrew/zsh-command-not-found-brew">zsh: command not found: brew</a> you need to install Homebrew first. Follow the instructions at <a href="https://mac.install.guide/homebrew/3">Install Homebrew</a>.</p>
<h2 id="heading-how-to-check-if-java-is-already-installed">How to Check if Java Is Already Installed</h2>
<p>Run this command to check for an existing Java installation:</p>
<pre><code class="language-bash">$ java -version
</code></pre>
<p>You'll see one of two results.</p>
<p><strong>If Java is installed,</strong> you'll see output like this:</p>
<pre><code class="language-bash">openjdk version "25.0.1" 2025-10-21 LTS
OpenJDK Runtime Environment Temurin-25.0.1+8 (build 25.0.1+8-LTS)
OpenJDK 64-Bit Server VM Temurin-25.0.1+8 (build 25.0.1+8-LTS, mixed mode)
</code></pre>
<p>If the version number shows 25, you already have the latest Java and you can stop here.</p>
<p><strong>If Java is not installed,</strong> you'll see a message, "The operation couldn't be completed. Unable to locate a Java Runtime." You'll need to install Java as described below.</p>
<p>If you previously installed Java but see this dialog, something is wrong with your installation. See <a href="https://mac.install.guide/java/unable-to-locate">Unable to Locate a Java Runtime</a> for troubleshooting. For detailed guidance on Java version output, see <a href="https://mac.install.guide/java/version">Check Java Version on Mac</a>.</p>
<h2 id="heading-why-eclipse-temurin-and-why-not-oracle">Why Eclipse Temurin and Why Not Oracle</h2>
<p>If you search for Java downloads, you'll encounter several potentially confusing terms. Here's what they mean.</p>
<p><strong>JDK</strong> stands for Java Development Kit. It contains the compiler, runtime, and developer tools you need to build and run Java applications. Vendors used to offer a JRE (Java Runtime Environment) for non-developers, but now the JDK does everything.</p>
<p><strong>OpenJDK</strong> is the official open-source implementation of Java. All major Java vendors build from this same source code, so the core functionality is identical across vendors.</p>
<p><strong>Eclipse Temurin</strong> is the distribution many developers recommend. It comes from the Adoptium project and is backed by IBM, Microsoft, Red Hat, and Google, among others. It's completely free for any use, including commercial production. Temurin is TCK-certified, meaning it passes Oracle's official compatibility tests (over 139,000 of them). You can trust that your Java code will run correctly.</p>
<p><strong>Why not Oracle JDK?</strong> Oracle changed its licensing in January 2023. The new model charges per employee across the entire organization, not per Java user. A 500-person company would pay $90,000 per year. Oracle actively audits for compliance.</p>
<p>Temurin is functionally identical to Oracle JDK and is free to use under its open‑source license, avoiding Oracle’s Java subscription fees.</p>
<p>If you deploy to AWS, Amazon Corretto is another good free option. If you need Java 8 for legacy code, Azul Zulu provides well-supported builds. For a comparison of Java distributions, see <a href="https://mac.install.guide/java/jdk">Install JDK on Mac</a>.</p>
<h2 id="heading-how-to-install-java-with-homebrew">How to Install Java with Homebrew</h2>
<p>Homebrew offers two ways to install Java: the cask method and the formula method. The cask method is easier because it installs the vendor's macOS package to the standard system location. Apple's macOS discovers it automatically with no extra configuration.</p>
<p>Run these two commands:</p>
<pre><code class="language-bash">$ brew update
$ brew install --cask temurin@25
</code></pre>
<p>The first command refreshes Homebrew's package list. The second downloads and installs Eclipse Temurin JDK 25.</p>
<p>Homebrew places the JDK at <code>/Library/Java/JavaVirtualMachines/temurin-25.jdk/</code>. This is the standard macOS location for Java installations. Apple's macOS includes a Java launcher at <code>/usr/bin/java</code> that automatically searches this directory. You don't need to configure your PATH.</p>
<p>Homebrew also detects your Mac's chip architecture automatically. You'll get the correct native build whether you have an Apple Silicon or Intel Mac.</p>
<p>For more details about the Homebrew installation process, including the alternative formula method and troubleshooting, see <a href="https://mac.install.guide/java/brew-cask">Brew Install Java, Cask Method</a>.</p>
<h2 id="heading-how-to-verify-the-installation">How to Verify the Installation</h2>
<p>After installation, open a new Terminal window. Existing windows may not detect the new installation.</p>
<p>Check the Java version:</p>
<pre><code class="language-bash">$ java -version
openjdk version "25.0.1" 2025-10-21 LTS
OpenJDK Runtime Environment Temurin-25.0.1+8 (build 25.0.1+8-LTS)
OpenJDK 64-Bit Server VM Temurin-25.0.1+8 (build 25.0.1+8-LTS, mixed mode)
</code></pre>
<p>This confirms three things: the version number (25.0.1), the distribution (Temurin), and that the 64-Bit Server VM is active.</p>
<p>Check the compiler:</p>
<pre><code class="language-bash">$ javac -version
javac 25.0.1
</code></pre>
<p>List all installed JDKs:</p>
<pre><code class="language-bash">$ /usr/libexec/java_home -V
Matching Java Virtual Machines (1):
    25.0.1 (arm64) "Eclipse Adoptium" - "OpenJDK 25.0.1" /Library/Java/JavaVirtualMachines/temurin-25.jdk/Contents/Home
</code></pre>
<p>If all three commands produce the expected output, Java is installed and working.</p>
<h2 id="heading-how-to-set-javahome-for-build-tools">How to Set JAVA_HOME for Build Tools</h2>
<p>For most users, Java works immediately after installation. The <code>java</code> and <code>javac</code> commands are available with no additional setup.</p>
<p>However, some build tools require the <code>JAVA_HOME</code> environment variable. Apache Maven, Gradle, and Android SDK all look for it. If you see errors mentioning "JAVA_HOME is not set," you need this step.</p>
<p>If you only run Java applications or use IntelliJ IDEA (which manages Java paths internally), you can skip this section.</p>
<p>Add this line to your <code>~/.zprofile</code> file:</p>
<pre><code class="language-bash">export JAVA_HOME=$(/usr/libexec/java_home)
</code></pre>
<p>This uses Apple's <code>java_home</code> utility to find the installed JDK automatically. After saving the file, you'll need to run <code>source ~/.zprofile</code> or close and reopen your terminal. Verify it works:</p>
<pre><code class="language-bash">\( echo \)JAVA_HOME
/Library/Java/JavaVirtualMachines/temurin-25.jdk/Contents/Home
</code></pre>
<p>For complete configuration instructions, see <a href="https://mac.install.guide/java/java-home">Set JAVA_HOME on Mac</a>.</p>
<h2 id="heading-how-to-troubleshoot-common-problems">How to Troubleshoot Common Problems</h2>
<p><strong>"Unable to locate a Java Runtime" message keeps appearing.</strong> Run <code>java -version</code> to verify Java is installed. If you just installed Java, see <a href="https://mac.install.guide/java/unable-to-locate">Unable to Locate a Java Runtime</a>.</p>
<p><strong>Wrong Java version appears.</strong> You have multiple JDKs installed and macOS selected a different one. Run <code>/usr/libexec/java_home -V</code> to list all installed versions. See <a href="https://mac.install.guide/java/java-home">Set JAVA_HOME on Mac</a> to point to the version you want.</p>
<h2 id="heading-alternative-installation-methods">Alternative Installation Methods</h2>
<p>Homebrew is the fastest path, but other options exist.</p>
<ol>
<li><p><strong>Manual download</strong>: You can download the .pkg installer directly from <a href="http://adoptium.net">adoptium.net</a> and double-click to install. This is a good choice if you don't use Homebrew. See <a href="https://mac.install.guide/java/install">Install Java on Mac</a> for detailed instructions.</p>
</li>
<li><p><strong>Homebrew formula.</strong> The command <code>brew install openjdk@25</code> installs a Homebrew-managed build. This approach requires manual symlink configuration before macOS can discover it. See <a href="https://mac.install.guide/java/brew-formula">Brew Install Java, Formula Method</a> for details.</p>
</li>
<li><p><strong>Version managers.</strong> Tools like SDKMAN and mise can install and switch between multiple Java versions per project. If you work on codebases that require different Java versions, see <a href="https://mac.install.guide/java/version-managers">Java Version Managers</a>.</p>
</li>
</ol>
<h2 id="heading-whats-next">What's Next</h2>
<p>You now have Java 25 installed on your Mac. You've verified it works and configured <code>JAVA_HOME</code> for build tools. You're ready to compile and run Java applications.</p>
<p>If your team or university course requires Java 21 instead, see <a href="https://mac.install.guide/java/java-21">Install Java 21 on Mac</a>. If you need to remove Java, see <a href="https://mac.install.guide/java/uninstall">Uninstall Java on Mac</a>.</p>
<p>This article is based on my guides that offer additional details about how to <a href="https://mac.install.guide/java/install">install Java on Mac</a> and choose the <a href="https://mac.install.guide/java/new">latest Java version</a>.</p>
 ]]>
                </content:encoded>
            </item>
        
            <item>
                <title>
                    <![CDATA[ What's New in macOS? How to Install the Sequoia Beta ]]>
                </title>
                <description>
                    <![CDATA[ The macOS Sequoia public beta is now available. Though the final release of macOS Sequoia (macOS 15) won't be available until late September or early October 2024, I'll show you how to install the public beta for an advance look. It's actually stable... ]]>
                </description>
                <link>https://www.freecodecamp.org/news/whats-new-in-macos-how-to-install-the-sequoia-beta/</link>
                <guid isPermaLink="false">66ba160b1f44b55a20d330e0</guid>
                
                    <category>
                        <![CDATA[ macOS ]]>
                    </category>
                
                    <category>
                        <![CDATA[ update  ]]>
                    </category>
                
                <dc:creator>
                    <![CDATA[ Daniel Kehoe ]]>
                </dc:creator>
                <pubDate>Tue, 30 Jul 2024 14:55:13 +0000</pubDate>
                <media:content url="https://www.freecodecamp.org/news/content/images/2024/07/sequoia-desktop-1058w.jpg" medium="image" />
                <content:encoded>
                    <![CDATA[ <p>The macOS Sequoia public beta is now available.</p>
<p>Though the final release of macOS Sequoia (macOS 15) won't be available until late September or early October 2024, I'll show you how to install the public beta for an advance look. It's actually stable enough for daily use.</p>
<p>The macOS Sequoia public beta is available to anyone who wants to try it, though you have to register with the <a target="_blank" href="https://beta.apple.com/">Apple Beta Software Program</a> to obtain it.</p>
<h2 id="heading-table-of-contents">Table of Contents</h2>
<ol>
<li><a class="post-section-overview" href="#heading-is-macos-sequoia-stable">Is macOS Sequoia stable?</a></li>
<li><a class="post-section-overview" href="#heading-time-needed-to-install">Time needed to install</a></li>
<li><a class="post-section-overview" href="#whats-new-in-macos-sequoia">What's new in macOS Sequoia</a></li>
<li><a class="post-section-overview" href="#new-features-in-macos-sequoia">Features in macOS Sequoia</a></li>
<li><a class="post-section-overview" href="#heading-small-changes-in-macos-sequoia">Small changes in macOS Sequoia</a></li>
<li><a class="post-section-overview" href="#heading-requirements-for-macos-sequoia">Requirements for macOS Sequoia</a></li>
<li><a class="post-section-overview" href="#back-up-your-mac-first">Back up your Mac first</a></li>
<li><a class="post-section-overview" href="#heading-sign-up-to-get-the-public-beta">Sign up to get the public beta</a></li>
<li><a class="post-section-overview" href="#heading-where-to-install-the-macos-beta">Where to install the macOS beta</a><br>– <a class="post-section-overview" href="#heading-install-on-a-spare-mac">Install on a spare Mac</a><br>– <a class="post-section-overview" href="#heading-install-on-an-external-drive">Install on an external drive</a><br>– <a class="post-section-overview" href="#heading-install-on-a-separate-volume">Install on a separate volume</a></li>
<li><a class="post-section-overview" href="#heading-use-the-startup-manager">Use the Startup Manager</a></li>
<li><a class="post-section-overview" href="#heading-halt-macos-beta-updates">Halt macOS beta updates</a></li>
<li><a class="post-section-overview" href="#heading-return-to-macos-sonoma">Return to macOS Sonoma</a></li>
<li><a class="post-section-overview" href="#whats-next">What's next</a></li>
</ol>
<h2 id="heading-is-macos-sequoia-stable">Is macOS Sequoia Stable?</h2>
<p>So far, users are reporting the beta version has only a few minor issues. They say the beta is "surprisingly stable." </p>
<p>There are reports of issues with external monitors, and users say to expect issues with external third-party devices. There may also be issues with screen sharing, video conferencing (Zoom particularly), or streaming in web browsers.</p>
<h2 id="heading-time-needed-to-install">Time Needed to Install</h2>
<p>The update from macOS Sonoma to macOS Sequoia can take more than an hour. The time needed varies widely based on factors such as the size of the update, your Internet speed, and the age and performance of your Mac.</p>
<h2 id="heading-whats-new-in-macos-sequoia">What's New in macOS Sequoia</h2>
<p>Users are reporting that macOS Sequoia is faster, with better battery life on laptops, but we can't be sure until we see the final release.</p>
<p>Looking closely at <a target="_blank" href="https://mac.install.guide/macos/sequoia">macOS Sequoia</a>, it's plain that it isn't a major overhaul of the operating system. The most useful features are Window Tiling and a new Passwords application, as well as iPhone mirroring and seamless drag and drop between devices.</p>
<p>I've compared <a target="_blank" href="https://mac.install.guide/macos/sonoma-vs-sequoia">Sonoma vs Sequoia</a> in a separate article, and also provided some advice to answer the question, <a target="_blank" href="https://mac.install.guide/macos/should-i-update">Should You Update to macOS Sequoia?</a></p>
<h2 id="heading-features-in-macos-sequoia">Features in macOS Sequoia</h2>
<p><img src="https://www.freecodecamp.org/news/content/images/2024/07/mac-passwords-app.png" alt="Image" width="600" height="400" loading="lazy">
<em>macOS Sequoia Passwords application</em></p>
<h3 id="heading-password-manager">Password Manager</h3>
<p>MacOS Sequoia adds a new app called Passwords, improving the way users manage their login credentials. </p>
<p>Built on the existing framework of Apple's Keychain, this app consolidates passwords, passkeys, Wi-Fi passwords, and other essential credentials into one secure, centralized location. </p>
<p>Credentials previously could be edited in System Settings but they were buried and hard to find. The new Passwords app will largely eliminate the need to use third-party password managers such as 1Password, LastPass, or Bitwarden.</p>
<p><img src="https://www.freecodecamp.org/news/content/images/2024/07/mac-sequoia-tiling.png" alt="Image" width="600" height="400" loading="lazy">
<em>macOS Sequoia Window Tiling</em></p>
<h3 id="heading-window-tiling">Window Tiling</h3>
<p>For years, Windows users have complained that MacOS lacks a tiling window manager. MacOS Sequoia adds a new feature called Window Tiling, which allows users to drag windows to the edge of the screen for placement side by side, top and bottom, or in a grid. Third-party utilities have more features but the built-in Window Tiling is a welcome addition.</p>
<p>These two features make an upgrade worthwhile. In addition, Apple has announced other capabilities.</p>
<h3 id="heading-iphone-mirroring">iPhone Mirroring</h3>
<p>This feature allows the use of iPhone apps within a macOS window. Users can now check iPhone notifications directly on their Mac, making the Mac an extension of the iPhone. </p>
<p>One user noted, “No longer do I have to find my phone when I am at home sitting in front of my Mac just to check on a notification.”</p>
<h3 id="heading-seamless-drag-and-drop-between-devices">Seamless Drag and Drop Between Devices</h3>
<p>This feature aims to improve the reliability of transferring files between iPhone and Mac, addressing issues with AirDrop. "Transferring files from Mac to an iPhone Apps no longer requires 5+ tedious steps," a user mentioned.</p>
<h3 id="heading-apple-intelligence">Apple Intelligence</h3>
<p>MacOS Sequoia will introduce the first use of Apple Intelligence, Apple's AI initiative. Apple Intelligence comprises new system-level capabilities, leveraging Apple custom silicon for both local and cloud-based processing. </p>
<p>This is more of a future prospect as AI gets baked in to more applications, but we may see improvements to Siri in macOS Sequoia. Note that these capabilities won't be present when you install macOS Sequoia on an Intel-based Mac.</p>
<h2 id="heading-small-changes-in-macos-sequoia">Small Changes in macOS Sequoia</h2>
<ul>
<li><strong>System Settings:</strong> Individual menus have been rearranged for quicker access to frequently used menus.</li>
<li><strong>Safari:</strong> The web browser has faster page load times, a new start page, and a brand new unified menu similar to "compact mode" on iOS. It can summarize websites and highlight relevant information.</li>
<li><strong>Notes:</strong> Minor improvements including collapsible sections and a choice of highlight styles. Also, Notes adds support for live audio transcription and math equations.</li>
<li><strong>Videoconferencing:</strong> Preview what you share in video calls for presentations and screen sharing. Also, background replacements are built into the macOS video feed so you won't need to use background replacements in Zoom or other conferencing apps.</li>
</ul>
<h2 id="heading-requirements-for-macos-sequoia">Requirements for macOS Sequoia</h2>
<p><a target="_blank" href="https://mac.install.guide/macos/check-version">Check your macOS version</a> and <a target="_blank" href="https://mac.install.guide/macos/update">update macOS</a> to Sonoma (macOS 14) before installing the macOS Sequoia beta.</p>
<p>You should keep the current macOS Sonoma available on your Mac, just in case you run into problems with the beta. That means you should install the macOS Sequoia beta on a separate volume, external drive, or a secondary Mac. </p>
<p>Also, macOS Sequoia does run on older Intel-based Macs, but it may be slow. So I recommend installing it only on Macs with M1, M2, or M3, the Apple Silicon chips.</p>
<p>You can install the macOS Sequoia beta on any computer that runs runs macOS Sonoma with the exception of the 2018–2019 MacBook Air models with Intel Amber Lake chips. Apple provides a <a target="_blank" href="https://www.apple.com/macos/macos-sequoia-preview/">list of supported models for macOS Sequoia</a>.</p>
<h2 id="heading-back-up-your-mac">Back Up Your Mac</h2>
<p>If you've got a new Mac that hasn't been used, you don't need to back up files. Or, if you're like many developers, you won't need to back up your Mac if you have all your important files stored in the cloud. </p>
<p>Otherwise, if there are important files on your computer, make sure you have a backup of your Mac before you install the macOS beta version.</p>
<h2 id="heading-sign-up-to-get-the-public-beta">Sign Up to Get the Public Beta</h2>
<p>Apple offers a public beta version as well as developer beta versions. The developer beta is released first and intended for software developers to test compatibility of applications, while the public beta is released a few weeks later. The public beta is more stable and has fewer bugs than the developer beta.</p>
<p><img src="https://www.freecodecamp.org/news/content/images/2024/07/apple-beta-program.png" alt="macOS Sequoia Public Beta" width="600" height="400" loading="lazy"></p>
<p>The public beta is available now, for free. Sign up for the public beta on the <a target="_blank" href="https://beta.apple.com/">Apple Beta Software Program</a> website. After you sign up with your Apple ID, your System Settings will show that beta updates are available.</p>
<h2 id="heading-where-to-install-the-macos-beta">Where to Install the macOS Beta</h2>
<p>Your best option is to install the macOS beta on a spare Mac, if you have an extra computer. Ideally, you have a relatively new Mac with an Apple Silicon M1, M2, or M3 chip. If you have an older Mac, you may want to avoid the beta version because it could slow down your computer. </p>
<p>Installing on a spare Mac allows you to try the new macOS version without affecting your daily productivity.</p>
<p>Alternatively, you can install the macOS beta on a separate volume on your Mac. This allows you to boot into the beta version when you want to try it out. </p>
<p>You can also install the beta version on an external drive. In either case, you need to hold the power button until you see the Startup Manager menu which lets you select an alternate to the default startup disk.</p>
<p>Here are instructions for installing the macOS Sequoia beta version on a spare Mac, an external drive, or a separate volume.</p>
<h3 id="heading-install-on-a-spare-mac">Install on a spare Mac</h3>
<p>Here's how to install the macOS Sequoia beta on a Mac running macOS Sonoma.</p>
<ol>
<li>Open <code>System Settings</code> and navigate to <code>General</code> and <code>Software Update</code>.</li>
<li>Click the "circle I" info button in <code>Beta Updates</code>.</li>
<li>Set the <code>Beta Updates</code> to <code>macOS Sequoia Public Beta</code>.</li>
<li>Click "Done" and your Mac will check for software updates.</li>
<li>After a check, the upgrade name appears with an "Upgrade Now" button.</li>
<li>Software updates require at least 20% battery power so you may need to connect to power if your battery is low.</li>
<li>Enter your password to start the software update. With a fast Internet connection, the download should take about 30 minutes. After the download, the "preparing" process will take about 15 minutes.</li>
<li>Your Mac will restart after the installation. You'll see the Apple logo and a progress bar. The installation process will take about 15 minutes with several automatic restarts.</li>
<li>After installation completes, you'll see the login screen. Enter your Mac password, then your Apple ID password, and "Continue" or "Set Up Later" through various agreements and settings.</li>
<li>The macOS Sequoia desktop will appear with a the Feedback Assistant application open. Use the Feedback Assistant to report any bugs or issues you encounter.</li>
<li>Check <code>About This Mac</code> to confirm you're running macOS 15.</li>
</ol>
<p>If you don't see <code>macOS Sequoia Public Beta</code> option in <code>Beta Updates</code>, sign up for the <a target="_blank" href="https://beta.apple.com/">Apple Beta Software Program</a>. After you sign up with your Apple ID, your System Settings will show that beta updates are available.</p>
<h3 id="heading-install-on-an-external-drive">Install on an external drive</h3>
<p>Not many users own an external drive now that cloud storage is popular. But if you have an external drive, you can install the macOS beta on it. </p>
<p>You'll need to format the drive so you must erase any files already on the drive. It's best if you own a fast SSD drive with a USB-C or Thunderbolt connection for use of the operating system. You can use a USB thumb drive, but you'll need at least 32 GB of space.</p>
<h4 id="heading-how-to-format-the-external-drive">How to format the external drive</h4>
<ol>
<li>Connect the external drive to your Mac.</li>
<li>Search in Spotlight and open <code>Disk Utility</code>.</li>
<li>Select the external drive in the left sidebar.</li>
<li>Click <code>Erase</code> to reformat the drive.</li>
<li>Name the drive <code>macOS Sequoia</code> or whatever you like.</li>
<li>Choose <code>Mac OS Extended (Journaled)</code> as the format.</li>
<li>Choose <code>GUID Partition Map</code> as the scheme.</li>
<li>Click <code>Erase</code> to format the drive.</li>
<li>Close <code>Disk Utility</code> after the drive formatting is done.</li>
</ol>
<h4 id="heading-how-to-get-the-macos-sequoia-beta">How to get the macOS Sequoia beta</h4>
<p>You'll need to download <code>*.pkg</code> files to install on an external drive. Several sites provide links to installer <code>*.pkg</code> files for macOS betas. Check:</p>
<ul>
<li><a target="_blank" href="https://betaprofiles.dev/install/macos-15/">betaprofiles.dev</a></li>
<li><a target="_blank" href="https://mrmacintosh.com/macos-sequoia-full-installer-database-download-directly-from-apple/">mrmacintosh.com</a></li>
</ul>
<p>Download the latest <code>InstallAssistant.pkg</code>. These files are huge (14GB or more) so a download may take more than 30 minutes with a fast Internet connection.</p>
<h4 id="heading-how-to-install-the-macos-sequoia-beta">How to install the macOS Sequoia beta</h4>
<p>Double click the <code>InstallAssistant.pkg</code> file to start the installation. Click "Change Install Location" to select the external drive. In the step "Destination Select" you can select the external drive as the installation destination.</p>
<h3 id="heading-install-on-a-separate-volume">Install on a separate volume</h3>
<p>If you want to install the macOS beta on a separate volume, follow these steps. You might hear this process called a "dual boot" or "separate partition" installation. Apple's APFS file system introduced "volumes" which are like partitions but more flexible. </p>
<p>You'll have two volumes on your Mac, one for macOS Sonoma and one for macOS Sequoia. You can use the Startup Manager to choose which volume to boot from.</p>
<h4 id="heading-how-to-create-a-new-volume">How to create a new volume</h4>
<ol>
<li>Search in Spotlight and open <code>Disk Utility</code>.</li>
<li>Select the internal drive in the left sidebar.</li>
<li>Click the <code>+</code> button in the top bar to add a new volume (or "Edit" &gt; "Add APFS Volume" in the menu).</li>
<li>Name the volume <code>macOS Sequoia</code> or whatever you like.</li>
<li>Choose a format (commonly "APFS").</li>
<li>Click <code>Add</code> to create the volume.</li>
<li>Click "Done" and close <code>Disk Utility</code> after the volume creation is done.</li>
</ol>
<h4 id="heading-get-the-macos-sequoia-beta">Get the macOS Sequoia beta</h4>
<p>You'll need to download <code>*.pkg</code> files to install on a separate volume. Several sites provide links to installer <code>*.pkg</code> files for macOS betas. Check:</p>
<ul>
<li><a target="_blank" href="https://betaprofiles.dev/install/macos-15/">betaprofiles.dev</a></li>
<li><a target="_blank" href="https://mrmacintosh.com/macos-sequoia-full-installer-database-download-directly-from-apple/">mrmacintosh.com</a></li>
</ul>
<p>Download the latest <code>InstallAssistant.pkg</code>. These files are huge (14GB or more) so a download may take more than 30 minutes with a fast Internet connection.</p>
<h4 id="heading-install-the-macos-sequoia-beta">Install the macOS Sequoia beta</h4>
<p>Double click the <code>InstallAssistant.pkg</code> file to start the installation. Click "Change Install Location" to select the volume you created. In the step "Destination Select" you can select the new volume as the installation destination.</p>
<h3 id="heading-use-the-startup-manager">Use the Startup Manager</h3>
<p>Hold down the power button when starting your Mac to enter the Startup Manager. "Loading startup options" will appear. You have a choice of booting from the internal drive, an external drive (if connected), a disk volume, or "Options."</p>
<p>Select the external drive or volume to boot from. You can set a default for the external drive or volume in <code>System Settings</code> &gt; <code>Startup Disk</code>.</p>
<h2 id="heading-halt-macos-beta-updates">Halt macOS Beta Updates</h2>
<p>If you don't want to continue using macOS Sequoia beta, you can turn off beta updates.</p>
<p>Go to <code>System Settings</code> &gt; <code>General</code> &gt; <code>Software Update</code>. Click the "circle I" info button in <code>Beta Updates</code> and set the <code>Beta Updates</code> to <code>Off</code>. This will stop the macOS beta updates.</p>
<p>This is a necessary step if you don't want to use the macOS beta. If you don't do this, your Mac will continue to update to the latest beta version.</p>
<h2 id="heading-return-to-macos-sonoma">Return to macOS Sonoma</h2>
<p>If you're using an external drive or separate volume to run the macOS beta, you still have macOS Sonoma on your Mac as the primary volume on the internal drive. Reformat the external drive or delete the volume if you no longer want to use the macOS beta.</p>
<h2 id="heading-restore-macos-sonoma-on-a-spare-mac">Restore macOS Sonoma on a Spare Mac</h2>
<p>If you are using macOS Sequoia on a spare Mac, you can restore macOS Sonoma by reinstalling it.</p>
<p>You can download and install macOS Sonoma from the Mac App Store. Search in the Mac App Store for "macOS Sonoma" or use this link to view the listing for <a target="_blank" href="https://apps.apple.com/us/app/macos-sonoma/id6450717509">macOS Sonoma</a>. Click "Get" and the App Store will open <code>System Settings</code> &gt; <code>General</code> &gt; <code>Software Update</code> and begin downloading macOS Sonoma. </p>
<p>Downloads from the App Store are slow, so expect a wait of an hour or more. The App Store installs an application <code>Install macOS Sonoma</code> in the <code>Applications</code> folder.</p>
<p>After the download is complete, the <code>Install macOS Sonoma</code> application will launch automatically. Follow the instructions to install macOS Sonoma.</p>
<p>Alternatively, you can directly download an installer <code>*.pkg</code> file to restore macOS Sonoma. The download is faster than the App Store. Check:</p>
<ul>
<li><a target="_blank" href="https://mrmacintosh.com/macos-sonoma-full-installer-database-download-directly-from-apple/">mrmacintosh.com</a></li>
</ul>
<p>Double click the <code>InstallAssistant.pkg</code> file to start the installation.</p>
<h2 id="heading-whats-next">What's Next</h2>
<p>After you've installed macOS Sequoia, I've got recommendations for a <a target="_blank" href="https://mac.install.guide/mac-setup/">Mac setup</a>, including <a target="_blank" href="https://mac.install.guide/mac-setup/name">Mac name settings</a>, <a target="_blank" href="https://mac.install.guide/mac-setup/dock">Dock settings</a>, and <a target="_blank" href="https://mac.install.guide/mac-setup/finder">Finder settings</a>.</p>
<p>For developing software on the Mac, you'll need to:</p>
<ul>
<li><a target="_blank" href="https://mac.install.guide/commandlinetools/3">Install Xcode Command Line Tools</a> for missing command line tools</li>
<li><a target="_blank" href="https://mac.install.guide/homebrew/3">Install Homebrew</a> as a software package manager</li>
<li><a target="_blank" href="https://mac.install.guide/git/">Install Git</a> for version control</li>
</ul>
<p>When you update macOS, you may also want to install newer software as well. Here are new and recommended applications for macOS Sequoia:</p>
<ul>
<li><a target="_blank" href="https://mac.install.guide/download/terminal">Terminal</a> alternatives</li>
<li><a target="_blank" href="https://mac.install.guide/download/text-editor">Text Editor</a> options</li>
<li><a target="_blank" href="https://mac.install.guide/download/chatgpt">ChatGPT desktop application</a> for better ChatGPT usability</li>
</ul>
<h2 id="heading-conclusion">Conclusion</h2>
<p>After October 2024, you'll need to update macOS from Sonoma to Sequoia to stay up to date with bug fixes, security, and software compatibility, especially if you are a software developer. </p>
<p>Before then, you can try out the macOS Sequoia beta to see what's new and provide feedback to Apple. See an article <a target="_blank" href="https://mac.install.guide/macos/beta">MacOS Beta</a> for more details.</p>
<p>Though macOS Sequoia doesn't bring spectacular changes, new features like Window Tiling and the Passwords app are useful. </p>
<p>Installing the macOS beta takes an hour or more, but you may find it is stable enough for daily use, giving you access to new features now.</p>
 ]]>
                </content:encoded>
            </item>
        
            <item>
                <title>
                    <![CDATA[ How to Fix Common Python Installation Errors on macOS ]]>
                </title>
                <description>
                    <![CDATA[ Python's popularity keeps growing as more developers adopt it for data science and machine learning, although it is already among the most popular programming languages.  I recently wrote an article for freeCodeCamp titled "How to Install Python on a... ]]>
                </description>
                <link>https://www.freecodecamp.org/news/how-to-fix-python-installation-errors-on-mac/</link>
                <guid isPermaLink="false">66ba1602ad32b828c4c5be08</guid>
                
                    <category>
                        <![CDATA[ error ]]>
                    </category>
                
                    <category>
                        <![CDATA[ macOS ]]>
                    </category>
                
                    <category>
                        <![CDATA[ Python ]]>
                    </category>
                
                <dc:creator>
                    <![CDATA[ Daniel Kehoe ]]>
                </dc:creator>
                <pubDate>Mon, 10 Jun 2024 22:57:27 +0000</pubDate>
                <media:content url="https://www.freecodecamp.org/news/content/images/2024/06/python-install-errors.png" medium="image" />
                <content:encoded>
                    <![CDATA[ <p>Python's popularity keeps growing as more developers adopt it for data science and machine learning, although it is already among the most popular programming languages. </p>
<p>I recently wrote an article for freeCodeCamp titled "<a target="_blank" href="https://www.freecodecamp.org/news/how-to-install-python-on-a-mac/">How to Install Python on a Mac</a>", which provides a clear guide to installing Python on macOS. </p>
<p>As a follow-up, I will discuss errors you may encounter when installing Python on macOS and how to fix them in this article.</p>
<h2 id="heading-contents"><strong>Contents</strong></h2>
<p>Here's what we'll cover here:</p>
<ul>
<li><a class="post-section-overview" href="#heading-how-to-fix-the-command-not-found-python-error">How to Fix the "command not found: python" Error</a></li>
<li><a class="post-section-overview" href="#using-an-out-of-date-python">Using an Out-of-date Python</a></li>
<li><a class="post-section-overview" href="#heading-using-the-system-python">Using the System Python</a></li>
<li><a class="post-section-overview" href="#heading-using-the-homebrew-python">Using the Homebrew Python</a></li>
<li><a class="post-section-overview" href="#heading-missing-pip">Missing Pip</a></li>
<li><a class="post-section-overview" href="#heading-pip-package-installation-errors">Pip Package Installation Errors</a></li>
<li><a class="post-section-overview" href="#heading-more-on-mac-python">More on Mac Python</a></li>
<li><a class="post-section-overview" href="#heading-conclusion">Conclusion</a></li>
</ul>
<h2 id="heading-how-to-fix-the-command-not-found-python-error">How to Fix the "command not found: python" Error</h2>
<p>You may encounter this error:</p>
<pre><code class="lang-bash">$ python ...
zsh: <span class="hljs-built_in">command</span> not found: python
</code></pre>
<p>You'll see this when trying to run Python commands in the terminal. This mostly happens because Python is yet to be installed. However, it is also possible, and more frustrating, that the Python installation is not in the Mac PATH.</p>
<p>If you only need to install and run a Python application, you can use <a target="_blank" href="https://mac.install.guide/homebrew/">Homebrew</a> to <a target="_blank" href="https://mac.install.guide/python/pipx">install Pipx</a>. This will install Python as a dependency. Pipx is a tool that allows you to install and run Python applications as standalone executables, avoiding dependency conflicts that can occur when using the standard Python package manager <a target="_blank" href="https://pip.pypa.io/en/stable/">Pip</a>.</p>
<p>If you're going to work on a programming project in Python, <a target="_blank" href="https://mac.install.guide/python/install-pyenv">install Python with Pyenv</a>, the standard Python version manager. Better yet, <a target="_blank" href="https://mac.install.guide/python/install-rye">install Python with Rye</a>, an all-in-one tool for Python installation, virtual environment management, and package installation.</p>
<p>If you're seeing the <code>zsh: command not found: python</code> error, and are certain you have already installed Python, you may need to update the <a target="_blank" href="https://mac.install.guide/python/path">Mac Python PATH</a>. You'll need to find where Python is installed on your system, which takes some sleuthing because there are multiple ways to install Python on macOS.</p>
<p>Here are the most common locations for Python on a Mac:</p>
<ol>
<li><code>/usr/bin/python3</code> is the system Python installed with Xcode Command Line Tools. This is an alias; the actual location is <code>/Library/Developer/CommandLineTools/Library/Frameworks/Python3.framework/Versions/3.9/bin</code>.</li>
<li><code>/opt/homebrew/opt/python@3.12/libexec/bin/python</code> is the Homebrew Python.</li>
<li><code>/Library/Frameworks/Python.framework/Versions/3.12/bin/python3</code> is the Python installed with the official Python website installer.</li>
<li><code>/Users/username/.pyenv/shims/python</code> is the Python installed with Pyenv.</li>
<li><code>/Users/username/.rye/shims/python</code> is the Python installed with Rye.</li>
</ol>
<p>Enter the full pathname followed by <code>python --version</code> and see if you get a version number. If you do, you'll need to update your PATH by adding the Python installation path to your <code>.zprofile</code> file. For more information, see  <a target="_blank" href="https://mac.install.guide/terminal/path">Mac  PATH</a>.</p>
<p>The article <a target="_blank" href="https://mac.install.guide/python/command-not-found-python">Command not found: python</a> goes into more detail if you need more help.</p>
<h2 id="heading-using-an-out-of-date-python-version">Using an Out-of-date Python Version</h2>
<p>The current Python version is 3.12, as of October 2023. New releases of Python come yearly, typically released in October. The next version, Python 3.13, is expected in October 2024. The <a target="_blank" href="https://www.python.org/downloads/source/">newest Python version</a> is listed on the Python website.</p>
<p>Check your Mac Python version:</p>
<pre><code class="lang-bash">$ python --version
Python 3.12.4
</code></pre>
<p>You should see <code>Python 3.12.4</code> or a later version. You may not notice issues with an older Python version but it's a good idea to start any project with the newest version. The article about <a target="_blank" href="https://mac.install.guide/python/update">updating Python on Mac</a> explains how to update Python on macOS.</p>
<h2 id="heading-using-the-system-python">Using the System Python</h2>
<p>Macs no longer come with Python pre-installed. But you may have installed <a target="_blank" href="https://mac.install.guide/commandlinetools/">Xcode Command Line Tools</a> which includes Python 3.9.6, an older Python version that supports Apple development utilities.</p>
<p>Try <code>python3 --version</code> and <code>which -a python3</code> to check if Python was installed with Xcode Command Line Tools.</p>
<pre><code class="lang-bash">$ python3 --version
Python 3.9.6
$ <span class="hljs-built_in">which</span> -a python3
/usr/bin/python3
</code></pre>
<p>If you have Python 3.9.6 installed at <code>/usr/bin/python3</code>, you'll likely have the system Python installed by Xcode Command Line Tools. You can confirm this with <code>xcode-select -p</code> which will show if Xcode Command Line Tools is installed.</p>
<pre><code class="lang-bash">$  xcode-select -p
/Library/Developer/CommandLineTools
</code></pre>
<p>It's possible to <a target="_blank" href="https://mac.install.guide/python/alias-python3">alias python3 to python</a> but I would not recommend using the system Python for development. The system Python is intended for Apple utilities, not for you, so you should install Python on macOS separately if you want to run Python programs or develop in Python.</p>
<p>See my freeCodeCamp article <a target="_blank" href="https://www.freecodecamp.org/news/how-to-install-python-on-a-mac/">How to Install Python on a Mac</a> to install Python for development.</p>
<h2 id="heading-using-the-homebrew-python">Using the Homebrew Python</h2>
<p>If you use Homebrew as a software package manager, you can easily install Python with <code>brew install python</code>. Homebrew-installed Python is suitable for running scripts but it has drawbacks for installing Python applications or Python software development, when packages are installed.</p>
<ul>
<li><strong>Homebrew's automatic updates.</strong> Homebrew automatically updates its Python as a dependency for other packages, potentially breaking your projects.</li>
<li><strong>Multiple projects may need different Python versions.</strong> Homebrew-installed Python is a single version and you may need to switch among different versions for different projects.</li>
<li><strong>Problems with environment isolation.</strong> Homebrew provides a single Python environment, which can cause conflicts between projects. Pip, the Python package manager, will block installation of packages unless you first create a virtual environment.</li>
</ul>
<p>You can check if Python is installed with Homebrew:</p>
<pre><code class="lang-bash">$ brew list | grep python
python@3.12
</code></pre>
<p>For running applications, it's best to <a target="_blank" href="https://mac.install.guide/python/pipx">install Pipx</a> and use <code>pipx install</code> instead of <code>pip install</code> to install programs. For Python development, it's best to  install Pyenv or install Rye for Python version management and virtual environments.</p>
<h2 id="heading-missing-pip">Missing Pip</h2>
<p>READMEs and tutorials often assume users are familiar with Python development tools and instruct them to install Python packages using Pip, the Python package manager. If you've followed instructions that start with <code>pip install &lt;package&gt;</code>, you may have run into the <code>zsh: command not found: pip</code> error.</p>
<p>This is the error you'll see:</p>
<pre><code class="lang-bash">$ pip install &lt;package&gt;
zsh: <span class="hljs-built_in">command</span> not found: pip
</code></pre>
<p>Pip is installed automatically with Python, so it's unusual to run the <code>python</code> command successfully and then <code>pip</code> and see the error. If you have Python installed, you should be able to use the <code>pip</code> command. You can try a special command that installs Pip:</p>
<pre><code class="lang-bash">$ python -m ensurepip --upgrade
</code></pre>
<p>If Pip is not already installed, this command will install it. Otherwise, nothing will happen. With this error, it's more likely that you have a Python installation that is not in your Mac Python PATH. See the article <a target="_blank" href="https://mac.install.guide/python/command-not-found-pip">Command not found: pip</a> for more details.</p>
<h2 id="heading-pip-package-installation-errors">Pip Package Installation Errors</h2>
<p>You will need to use Pip to install Python packages, unless you are using <a target="_blank" href="https://rye.astral.sh/">Rye</a> as an all-in-one tool. However, Pip has some drawbacks.</p>
<p>By default, the <code>pip install &lt;package&gt;</code> command installs the package "globally." This means that the package is added to the global Python <code>site-packages</code> directory, which may result in conflicts if different projects require different versions of the same package. </p>
<p>For example, if project A requires <code>package==1.0</code> and project B requires <code>package==2.0</code>, installing both packages globally may result in conflicts and <a target="_blank" href="https://en.wikipedia.org/wiki/Dependency_hell">dependency hell</a>. Without proper isolation, installing one project's dependencies can cause problems for another. To avoid these conflicts, create a Python virtual environment for each project.</p>
<p>There are two Python tools for creating virtual environments and using different versions of packages. <a target="_blank" href="https://docs.python.org/3/library/venv">Venv</a> is a built-in Python package. <a target="_blank" href="https://virtualenv.pypa.io/en/latest/">Virtualenv</a> is a more powerful tool with additional features. These tools allow <code>pip</code> to install Python packages into a virtual environment that has its own installation directories and does not share libraries with other virtual environments. Pip must be used in conjunction with either Venv or Virtualenv to successfully install packages.</p>
<p>When you try to install a package with Pip, you may see:</p>
<pre><code class="lang-bash">$ pip install &lt;package&gt;
error: externally-managed-environment
</code></pre>
<p>Recent versions of <code>pip</code> implement <a target="_blank" href="https://peps.python.org/pep-0668/">PEP 668</a> to prevent attempts to install packages globally, which results in the message <a target="_blank" href="https://mac.install.guide/python/externally-managed-environment">error: externally-managed-environment</a>. This error occurs when attempting to install a package globally without using a virtual environment. To resolve this error, create a virtual environment using Venv or Virtualenv and install the package within it.</p>
<h2 id="heading-more-on-mac-python">More on Mac Python</h2>
<p>You'll need to do more than install Python to begin a programming project, so I've also written a longer article about <a target="_blank" href="https://mac.install.guide/python/">Mac Python</a> that explains the fundamentals of version management, virtual environments, and package management, as well as comparing various installation options.</p>
<h2 id="heading-conclusion">Conclusion</h2>
<p>A variety of competing development tools means that it can be difficult to get started with Python compared to other programming languages such as JavaScript, Rust, or Ruby. Python is moving towards standardization of tools, and there's rapid innovation as the community seeks to improve the developer experience.</p>
<p>For now, developing Python skills requires some knowledge of the Python ecosystem, the various tools, and how to use them. Still, Python is popular and powerful, and the tutorials on freeCodeCamp will help you learn the language and become a better developer.</p>
 ]]>
                </content:encoded>
            </item>
        
            <item>
                <title>
                    <![CDATA[ How to Install Python on a Mac ]]>
                </title>
                <description>
                    <![CDATA[ Python is the most popular first language for programmers on a Mac. Until recently, the language's lack of standard development tooling, plus competing optional-but-essential development tools, meant a rocky start for Python beginners.  To cut throug... ]]>
                </description>
                <link>https://www.freecodecamp.org/news/how-to-install-python-on-a-mac/</link>
                <guid isPermaLink="false">66ba16062ab35c1de21292ee</guid>
                
                    <category>
                        <![CDATA[ Python ]]>
                    </category>
                
                    <category>
                        <![CDATA[ Python 3 ]]>
                    </category>
                
                <dc:creator>
                    <![CDATA[ Daniel Kehoe ]]>
                </dc:creator>
                <pubDate>Thu, 09 May 2024 06:33:00 +0000</pubDate>
                <media:content url="https://www.freecodecamp.org/news/content/images/2024/05/python-shop.png" medium="image" />
                <content:encoded>
                    <![CDATA[ <p>Python is the most popular first language for programmers on a Mac.</p>
<p>Until recently, the language's lack of standard development tooling, plus competing optional-but-essential development tools, meant a rocky start for Python beginners. </p>
<p>To cut through the confusion, I'll show you an up-to-date approach to install Python and set up a programming project, using a single tool named Rye, to install Python versions and software libraries.</p>
<p><a target="_blank" href="https://rye-up.com/">Rye</a> is an all-in-one project management tool for Python, written in Rust (for speed) and inspired by Cargo, Rust's comprehensive package manager, from Armin Ronacher, the creator of the Python web framework Flask. It's ideal for beginners, borrowing a folder-based approach to development from other languages such as JavaScript and Ruby.</p>
<h2 id="heading-contents">Contents</h2>
<p>You'll want to save the URL for this guide for future reference. Here's what is covered here:</p>
<ul>
<li><a class="post-section-overview" href="#heading-before-you-get-started">Before You Get Started</a></li>
<li><a class="post-section-overview" href="#heading-python-installation-with-rye">Python Installation with Rye</a>  </li>
<li><a class="post-section-overview" href="#heading-check-for-python">Check for Python</a>  </li>
<li><a class="post-section-overview" href="#heading-install-rye">Install Rye</a>  </li>
<li><a class="post-section-overview" href="#heading-set-the-path-for-rye">Set the PATH for Rye</a>  </li>
<li><a class="post-section-overview" href="#heading-verify-rye-installation">Verify Rye installation</a>  </li>
<li><a class="post-section-overview" href="#heading-verify-python-installation">Verify Python installation</a></li>
<li><a class="post-section-overview" href="#heading-version-and-package-management-with-rye">Version and Package Management with Rye</a>  </li>
<li><a class="post-section-overview" href="#heading-create-a-project-with-rye">Create a project with Rye</a>  </li>
<li><a class="post-section-overview" href="#heading-set-a-version">Set a version</a>  </li>
<li><a class="post-section-overview" href="#heading-add-packages">Add packages</a>  </li>
<li><a class="post-section-overview" href="#heading-sync-to-set-up-the-project">Sync to set up the project</a>  </li>
<li><a class="post-section-overview" href="#heading-run-python">Run Python</a></li>
<li><a class="post-section-overview" href="#heading-python-workflow-with-rye">Python Workflow with Rye</a></li>
<li><a class="post-section-overview" href="#heading-conclusion">Conclusion</a></li>
</ul>
<h2 id="heading-before-you-get-started">Before You Get Started</h2>
<p>You'll need a terminal application, either <a target="_blank" href="https://mac.install.guide/terminal/">Mac Terminal</a> or an alternative such as <a target="_blank" href="https://mac.install.guide/more/download-warp">Warp Terminal</a> (a tool I call, "the fastest way to become a command-line power user").</p>
<p>Before you get started, check if you need to <a target="_blank" href="https://mac.install.guide/commandlinetools/1">update macOS</a>.</p>
<p>You may have heard that Python is pre-installed on your Mac. Older Macs (prior to macOS 12.3) came with Python 2.7. That's an older version, not the Python 3 that you need. Newer Macs don't come with a pre-installed Python. </p>
<p>You'll need to install <a target="_blank" href="https://mac.install.guide/commandlinetools/">Xcode Command Line Tools</a> before you begin programming on a Mac. You should check if <a target="_blank" href="https://mac.install.guide/commandlinetools/2">Xcode Command Line Tools are installed</a> before you proceed further. When you install Xcode Command Line Tools, Apple includes Python 3.9.6. You might be tempted to use it but that's an older version, intended only for system software, which is why you should install a new version of Python, as shown here.</p>
<h2 id="heading-python-installation-with-rye">Python Installation with Rye</h2>
<p>There are several ways to set up <a target="_blank" href="https://mac.install.guide/python/">Mac Python</a>. Here are your options, in a nutshell, with a critique.</p>
<p>On the <a target="_blank" href="https://www.python.org/downloads/">Python.org website</a>, there's an installer application for the most recent Python version. Most Python developers avoid using it because it clutters a Mac in ways that are difficult to manage.</p>
<p>If you <a target="_blank" href="https://mac.install.guide/homebrew/3">install Homebrew</a> for software development, it's easy to <a target="_blank" href="https://mac.install.guide/python/brew">"brew install python."</a> However, the Homebrew-installed Python is not well-suited to managing multiple Python projects and development can be cumbersome.</p>
<p>Some tutorials suggest to <a target="_blank" href="https://mac.install.guide/python/install-pyenv">install Pyenv</a>, a Python version manager. Pyenv is a good choice for managing multiple Python versions, but it requires familiarity with <a target="_blank" href="https://pip.pypa.io/en/stable/">Pip</a>, a package manager, and <a target="_blank" href="https://docs.python.org/3/library/venv">Venv</a> or <a target="_blank" href="https://virtualenv.pypa.io/en/latest/">Virtualenv</a>, environment managers. Multiple tools make development more complex.</p>
<p>I recommend installing Python with <a target="_blank" href="https://rye-up.com/">Rye</a>. With this all-in-one tool, you'll manage multiple Python versions, set up project-based environments, and install Python packages without dependency conflicts. I'll show you how to install Python using Rye, the easy way, with a self-install script.</p>
<h3 id="heading-check-for-python">Check for Python</h3>
<p>It's best to start with no previous Python version installed, except for the Python version installed by Xcode Command Line Tools.</p>
<p>Try <code>python3 --version</code> and <code>which -a python3</code> to check if Python was installed with Xcode Command Line Tools:</p>
<pre><code class="lang-bash">$ python3 --version
Python 3.9.6
$ <span class="hljs-built_in">which</span> -a python3
/usr/bin/python3
</code></pre>
<p>You won't use the Python installed by Xcode Command Line Tools, but it's important to know that Xcode Command Line Tools is already there. Otherwise, <a target="_blank" href="https://mac.install.guide/commandlinetools/4">install Xcode Command Line Tools</a>.</p>
<p>Check if another version of Python is already installed:</p>
<pre><code class="lang-bash">$ python --version
zsh: <span class="hljs-built_in">command</span> not found: python
</code></pre>
<p>You'll see <code>zsh: command not found: python</code> if Python is not available. I've written elsewhere about how to <a target="_blank" href="https://mac.install.guide/python/update">update Python</a> if you think you already have Python, as well as a guide to resolving the error "<a target="_blank" href="https://mac.install.guide/python/command-not-found-python">command not found: python</a>" if you are sure Python is installed but not available.</p>
<p>If you have more than one version of Python installed, it's not a problem because you'll set the <a target="_blank" href="https://mac.install.guide/terminal/path">Mac PATH</a> after installing Rye to make the correct Python version available.</p>
<h3 id="heading-install-rye">Install Rye</h3>
<p>Homebrew is not needed. Rye has a self-install script so you can install Rye with a <code>curl</code> command.</p>
<pre><code class="lang-bash">$ curl -sSf https://rye.astral.sh/get | bash
</code></pre>
<p><a target="_blank" href="https://curl.se/">Curl</a> is a command-line tool that makes HTTP requests from the terminal, useful for tasks like downloading and running installation scripts.</p>
<pre><code class="lang-bash">$ curl -sSf https://rye.astral.sh/get | bash
This script will automatically download and install rye (latest) <span class="hljs-keyword">for</span> you.
<span class="hljs-comment">####################################################################### 100.0%</span>
Welcome to Rye!

This installer will install rye to /Users/username/.rye
This path can be changed by exporting the RYE_HOME environment variable.

Details:
  Rye Version: 0.26.0
  Platform: macos (aarch64)

? Continue? (y/n)
</code></pre>
<p>Enter <code>y</code> to continue. Rye will ask questions to customize the installation.</p>
<pre><code class="lang-bash">? Select the preferred package installer ›
❯ uv (fast, recommended)
  pip-tools (slow, higher compatibility)
</code></pre>
<p>By default, Rye offers <code>uv</code>, a faster and newer package installer. I recommend choosing <code>pip-tools</code> for compatibility. If you're a beginner, it will be easier to follow tutorials that refer to <code>pip</code>. Select <code>pip-tools</code> with the arrow keys.</p>
<p>Next, the self-installer asks which Python version you'll use as a default, offering the Rye-installed version or previously-installed versions.</p>
<pre><code class="lang-bash">? What should running `python` or `python3` <span class="hljs-keyword">do</span> when you are not inside a Rye managed project? ›
❯ Run a Python installed and managed by Rye
  Run the old default Python (provided by your OS, pyenv, etc.)
</code></pre>
<p>It's best to use the Rye-installed version. Accept the default <code>Run a Python installed and managed by Rye</code> by pressing "Enter". Then the self-installer asks which Python version to install as a default.</p>
<pre><code class="lang-bash">? Which version of Python should be used as default toolchain? (cpython@3.12) ›
</code></pre>
<p>Accept the default and Rye will install the latest Python version. Installation begins when you press "Enter." </p>
<pre><code class="lang-bash">Installed binary to /Users/username/.rye/shims/rye
Bootstrapping rye internals
Downloading cpython@3.12.1
Checking checksum
Unpacking
Downloaded cpython@3.12.1
Updated self-python installation at /Users/username/.rye/self

The rye directory /Users/username/.rye/shims was not detected on PATH.
It is highly recommended that you add it.
? Should the installer add Rye to PATH via .profile? (y/n) ›
</code></pre>
<p>Notice that Rye installs its Python files to <code>~/.rye/shims/rye</code>.</p>
<p>Rye offers to set the <code>$PATH</code> to give precedence to its Python version by modifying the <code>.profile</code> file. </p>
<p>Use of the <code>.profile</code> file is a Linux convention. On the Mac, it's preferred to set the <code>$PATH</code> in <code>.zprofile</code> or <code>.zshrc</code> files, preferably <code>.zprofile</code>. Enter <code>n</code> to skip this automatic step. Later, you'll set the <code>$PATH</code> manually.</p>
<pre><code class="lang-bash">✔ Should the installer add Rye to PATH via .profile? · no
note: did not manipulate the path. To make it work, add this to your .profile manually:

    <span class="hljs-built_in">source</span> <span class="hljs-string">"<span class="hljs-variable">$HOME</span>/.rye/env"</span>

To make it work with zsh, you might need to add this to your .zprofile:

    <span class="hljs-built_in">source</span> <span class="hljs-string">"<span class="hljs-variable">$HOME</span>/.rye/env"</span>

For more information <span class="hljs-built_in">read</span> https://rye.astral.sh/guide/installation/

All <span class="hljs-keyword">done</span>!
</code></pre>
<p>Rye explains how to complete the installation manually by editing the <code>.zprofile</code> file. I'll show you how do it.</p>
<h3 id="heading-set-the-path-for-rye">Set the PATH for Rye</h3>
<p>There's one final <strong>important</strong> step before Rye works correctly. You must set the Mac PATH to make sure Rye finds the correct Python version. Otherwise, entering the command <code>python</code> will trigger <code>zsh: command not found: python</code> and the command <code>python3</code> will access the older Xcode-installed Python version.</p>
<p>Edit the <code>~/.zprofile</code> file. The <code>~/.zprofile</code> file is used for setting the <code>$PATH</code>. Alternatively, you can modify the <code>~/.zshrc</code> file (see <a target="_blank" href="https://www.freecodecamp.org/news/how-do-zsh-configuration-files-work/">How Do Zsh Configuration Files Work?</a> for an explanation of the differences). You can use TextEdit, the default macOS graphical text editor, opening a file from the terminal:</p>
<pre><code class="lang-bash">$ open -e ~/.zprofile
</code></pre>
<p>You also can use the command line editors <code>nano</code> or <code>vim</code> to edit the shell configuration files. See <a target="_blank" href="https://mac.install.guide/terminal/configuration">Zsh Shell Configuration</a> for more about editing shell configuration files.</p>
<p>Add this command as the last line of your configuration file to configure the Z shell for Rye:</p>
<pre><code class="lang-bash"><span class="hljs-built_in">source</span> <span class="hljs-string">"<span class="hljs-variable">$HOME</span>/.rye/env"</span>
</code></pre>
<p>When your terminal session starts, Z shell will run the <code>~/.rye/env</code> script to set <a target="_blank" href="https://rye-up.com/guide/shims/">shims</a> to intercept and redirect any Python commands. You'll need double quotes because the command contains special characters. </p>
<p>Rye adds the shims to your <code>$PATH</code> so that running the command <code>python</code> or <code>python3</code> will run a Rye-installed Python version.</p>
<p>Changes to the <code>~/.zprofile</code> file will not take effect in the Terminal until you've quit and restarted the terminal. Alternatively (this is easier), you can use the <code>source</code> command to reset the shell environment:</p>
<pre><code class="lang-bash">$ <span class="hljs-built_in">source</span> ~/.zprofile
</code></pre>
<p>The <code>source</code> command reads and executes a shell script file, in this case resetting the shell environment with your new <code>$PATH</code> setting.</p>
<p>After resetting your shell, you can check the <code>$PATH</code> setting.</p>
<pre><code class="lang-bash">$ <span class="hljs-built_in">echo</span> <span class="hljs-variable">$PATH</span>
/Users/username/.rye/shims:/opt/homebrew/bin:/opt/homebrew/sbin:/opt/homebrew/bin:/opt/homebrew/sbin:/usr/<span class="hljs-built_in">local</span>/bin:/System/Cryptexes/App/usr/bin:/usr/bin:/bin:/usr/sbin:/sbin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/<span class="hljs-built_in">local</span>/bin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/bin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/appleinternal/bin
</code></pre>
<p>The <code>~/.rye/shims</code> directory should be leftmost, taking precedence over other directories.</p>
<h3 id="heading-verify-rye-installation">Verify Rye installation</h3>
<p>After installing Rye, use <code>rye --version</code> to verify that it has been installed.</p>
<pre><code class="lang-bash">$ rye --version
rye 0.26.0
commit: 0.26.0 (d245f625e 2024-02-23)
platform: macos (aarch64)
self-python: cpython@3.12
symlink support: <span class="hljs-literal">true</span>
uv enabled: <span class="hljs-literal">false</span>
</code></pre>
<h3 id="heading-verify-python-installation">Verify Python installation</h3>
<p>Check that Python is available:</p>
<pre><code class="lang-bash">$ python --version
Python 3.12.1
</code></pre>
<p>Yay! You've installed Python. If you see <code>zsh: command not found: python</code>, check that the Mac PATH is set correctly.</p>
<p>The <code>python3</code> command should give you the Rye-installed version, not the Xcode-installed version.</p>
<pre><code class="lang-bash">$ python3 --version
Python 3.12.1
</code></pre>
<p>The <code>which</code> command shows the Rye shims directory when you try to see where Python is installed. Keep in mind that you've set the <code>~/.zprofile</code> file to use Rye shims to intercept the <code>python</code> command and deliver the Rye-installed versions.</p>
<pre><code class="lang-bash">$ <span class="hljs-built_in">which</span> python
/Users/username/.rye/shims/python
</code></pre>
<p>You've successfully installed Python with Rye.</p>
<h2 id="heading-version-and-package-management-with-rye">Version and Package Management with Rye</h2>
<p>You can use Rye to:</p>
<ol>
<li>Set up a Python project.</li>
<li>Install a specific Python version for a project.</li>
<li>Install Python packages for the project.</li>
</ol>
<p>Other languages adopt a project-based approach to package management (for example, Rust's Cargo, Ruby's Bundler, and JavaScript's npm). Python has been slow to adopt this approach, but Rye is changing that, eliminating the need for separate tools such as Pyenv, Pip, and Venv for managing versions, software libraries, and environments.</p>
<p>With Rye, you'll start by creating a new project and choosing a Python version. You can then install packages for that project. Rye will manage the Python version and packages for you.</p>
<h3 id="heading-create-a-project-with-rye">Create a project with Rye</h3>
<p>Make a folder for a Python project. Then change directories to the project root:</p>
<pre><code class="lang-bash">$ mkdir myproject
$ <span class="hljs-built_in">cd</span> myproject
</code></pre>
<p>Specify a Python version for your project:</p>
<pre><code class="lang-bash">$ rye pin 3
pinned 3.12.1 <span class="hljs-keyword">in</span> /Users/username/workspace/myproject/.python-version
</code></pre>
<p>The command <code>rye pin 3</code> will create a <code>.python-version</code> file specifying the newest Python version for your project.</p>
<p>You must run the command <code>rye init</code> to create a <code>pyproject.toml</code> file in your project root directory. This is a project-specific configuration file that Rye uses to manage Python versions and packages.</p>
<pre><code class="lang-bash">$ rye init
success: Initialized project <span class="hljs-keyword">in</span> /Users/username/workspace/myproject/.
Run `rye sync` to get started
</code></pre>
<p>Now you can fetch a Python version and install packages.</p>
<h3 id="heading-set-a-version">Set a version</h3>
<p>Rye can install and switch among different Python versions.</p>
<p>Rye uses the term "toolchains" to refer to installed Python versions. To install a Python version, you can <a target="_blank" href="https://rye-up.com/guide/toolchains/">fetch a toolchain</a> using Rye.</p>
<pre><code class="lang-bash">$ rye fetch
$
</code></pre>
<p>If you've specified the default Python with <code>rye pin</code>, <code>rye fetch</code> does nothing. If you specified a different Python version, <code>rye fetch</code> will install the specified version.</p>
<pre><code class="lang-bash">$ rye fetch
Downloading cpython@3.12.1
Checking checksum
success: Downloaded cpython@3.12.1
</code></pre>
<p>By default, Rye installs all Python executables in a hidden folder in your user home directory <code>~/.rye/py/</code>. The Rye shims in the Mac <code>$PATH</code> will select the correct Python version you've specified in your project directory,</p>
<h3 id="heading-add-packages">Add packages</h3>
<p>Package managers allow you to download, install, and update software libraries and their dependencies. Most packages depend on other external software libraries—the package manager will fetch and install any dependencies required by that package.</p>
<p>Experienced Python developers are familiar with <a target="_blank" href="https://pip.pypa.io/en/stable/">Pip</a>, the standard package manager for Python, included with any version of Python since Python 3.3. </p>
<p>The command <code>pip install</code> installs packages "globally" into a system Python or shared Python versions, creating potential conflicts. </p>
<p>To safely install Python packages for a specific project with <code>pip</code>, you have to use a Python environment manager such as <a target="_blank" href="https://docs.python.org/3/library/venv">Venv</a> to create and activate a virtual environment to avoid dependency conflicts. </p>
<p>When you use Rye as an all-in-one tool, you won't need <code>venv</code> for environment management, installing packages directly with Rye.</p>
<p>Before you try to install a package with Rye, be sure you've created a <code>pyproject.toml</code> file in your project root directory with <code>rye init</code>.</p>
<p>You can install any Python package from the <a target="_blank" href="https://pypi.org/">Python Package Index</a>. Here we'll install the <a target="_blank" href="https://pypi.org/project/cowsay/">cowsay</a> utility.</p>
<pre><code class="lang-bash">$ rye add cowsay
Added cowsay&gt;=6.1 as regular dependency
</code></pre>
<p>If you see <code>error: did not find pyproject.toml</code>, you need to run <code>rye init</code>.</p>
<h3 id="heading-sync-to-set-up-the-project">Sync to set up the project</h3>
<p>Before you can use a package in a Rye project, you must run <code>rye sync</code> to update lockfiles and install the dependencies into the virtual environment.</p>
<pre><code class="lang-bash">$ rye sync
Initializing new virtualenv <span class="hljs-keyword">in</span> /Users/username/workspace/python/myproject/.venv
Python version: cpython@3.12.3
Generating production lockfile: /Users/username/workspace/python/myproject/requirements.lock
Creating virtualenv <span class="hljs-keyword">for</span> pip-tools
Generating dev lockfile: /Users/username/workspace/python/myproject/requirements-dev.lock
Installing dependencies
Looking <span class="hljs-keyword">in</span> indexes: https://pypi.org/simple/
Obtaining file:///. (from -r /var/folders/ls/g23m524x5jbg401p12rctz7m0000gn/T/tmp06o05xiq (line 2))
  Installing build dependencies ... <span class="hljs-keyword">done</span>
  Checking <span class="hljs-keyword">if</span> build backend supports build_editable ... <span class="hljs-keyword">done</span>
  Getting requirements to build editable ... <span class="hljs-keyword">done</span>
  Installing backend dependencies ... <span class="hljs-keyword">done</span>
  Preparing editable metadata (pyproject.toml) ... <span class="hljs-keyword">done</span>
Collecting cowsay==6.1 (from -r /var/folders/ls/g23m524x5jbg401p12rctz7m0000gn/T/tmp06o05xiq (line 1))
  Using cached cowsay-6.1-py3-none-any.whl.metadata (5.6 kB)
Using cached cowsay-6.1-py3-none-any.whl (25 kB)
Building wheels <span class="hljs-keyword">for</span> collected packages: myproject
  Building editable <span class="hljs-keyword">for</span> myproject (pyproject.toml) ... <span class="hljs-keyword">done</span>
  Created wheel <span class="hljs-keyword">for</span> myproject: filename=myproject-0.1.0-py3-none-any.whl size=1074 sha256=0b34a41cbb517a78e5b60593c75e93a37df0bf7958e8921be5f6f6e24a26b5d1
  Stored <span class="hljs-keyword">in</span> directory: /private/var/folders/ls/g23m524x5jbg401p12rctz7m0000gn/T/pip-ephem-wheel-cache-m03jgkok/wheels/8b/19/c8/73a63a20645e0f1ed9aae9dd5d459f0f7ad2332bb27cba6c0f
Successfully built myproject
Installing collected packages: myproject, cowsay
Successfully installed cowsay-6.1 myproject-0.1.0
Done!
</code></pre>
<p>Rye displays all its operations but you don't have to read all the details.</p>
<h3 id="heading-run-python">Run Python</h3>
<p>After installing a package and running <code>rye sync</code>, you can use the Python interpreter interactively (the REPL or Read-Eval-Print Loop).</p>
<pre><code class="lang-bash">$ python
Python 3.12.1 (main, Jan  7 2024, 23:31:12) [Clang 16.0.3 ] on darwin
Type <span class="hljs-string">"help"</span>, <span class="hljs-string">"copyright"</span>, <span class="hljs-string">"credits"</span> or <span class="hljs-string">"license"</span> <span class="hljs-keyword">for</span> more information.
&gt;&gt;&gt; import cowsay
&gt;&gt;&gt; cowsay.cow(<span class="hljs-string">'Hello World'</span>)
___________
| Hello World |
  ===========
           \
            \
              ^__^
              (oo)\_______
              (__)\       )\/\
                  ||----w |
                  ||     ||
&gt;&gt;&gt;
</code></pre>
<p>Enter <code>quit()</code> or type <code>Control + D</code> to exit the Python interpreter.</p>
<p>Now you're ready to develop any Python project with Rye! You can read the <a target="_blank" href="https://rye-up.com/guide/">Rye User Guide</a> to learn more.</p>
<h2 id="heading-python-workflow-with-rye">Python Workflow with Rye</h2>
<p>As you code in Python, you'll want to add software libraries to your project. Let's look at an example.</p>
<p><a target="_blank" href="https://pypi.org/project/requests/">Requests</a> is an HTTP library that you'll likely use in many projects. If you visit the <a target="_blank" href="https://pypi.org/project/requests/">Requests page on PyPI</a>, you'll see the installation instructions:</p>
<pre><code class="lang-bash">$ python -m pip install requests
</code></pre>
<p>The <code>python -m pip</code> command is a bit cumbersome, and if you use Pip, you have to precede it with <code>python -m venv .venv</code> (to set up a virtual environment) and <code>source .venv/bin/activate</code> (to activate a virtual environment). </p>
<p>With Rye, you can add Requests to your <code>pyproject.toml</code> file.</p>
<pre><code class="lang-bash">$ rye add requests
</code></pre>
<p>Then run <code>rye sync</code> to install the package.</p>
<pre><code class="lang-bash">$ rye sync
</code></pre>
<p>Now you can use the Requests library in your Python project, including it with an <code>import</code> statement.</p>
<p>Remember, when you see <code>pip install</code> in a tutorial, you can use <code>rye add</code> and <code>rye sync</code> instead, without additional commands for a virtual environment. </p>
<p>Beginners using <a target="_blank" href="https://mac.install.guide/python/pip-install">pip install</a> often encounter headaches with <a target="_blank" href="https://mac.install.guide/python/command-not-found-pip">command not found: pip</a> and <a target="_blank" href="https://mac.install.guide/python/externally-managed-environment">error: externally-managed-environment</a>. Rye eliminates these problems.</p>
<h2 id="heading-conclusion">Conclusion</h2>
<p>This article is based on a guide that offers additional details about how to <a target="_blank" href="https://mac.install.guide/python/install">install Python on Mac</a>.</p>
<p>Rye is the new favorite for installing and managing Python because it offers a single coherent setup and packaging system, eliminating the need for separate tools such as Pyenv, Pip, and Venv for managing versions, software libraries, and environments.</p>
<p>Python is the first programming language for most beginners. As it grows in popularity for machine learning and data science, you'll want Python on your Mac for many of the tutorials you'll find on freeCodeCamp.</p>
 ]]>
                </content:encoded>
            </item>
        
            <item>
                <title>
                    <![CDATA[ How Do Zsh Configuration Files Work? ]]>
                </title>
                <description>
                    <![CDATA[ Beginners often get confused when configuring Zsh shell on a Mac. Zsh shell offers four configuration files with no discernible differences. Particularly, ~/.zshrc and ~/.zprofile appear to be identical, leaving us wondering which one to use.  In thi... ]]>
                </description>
                <link>https://www.freecodecamp.org/news/how-do-zsh-configuration-files-work/</link>
                <guid isPermaLink="false">66ba15ffad32b828c4c5be04</guid>
                
                    <category>
                        <![CDATA[ macOS ]]>
                    </category>
                
                    <category>
                        <![CDATA[ shell ]]>
                    </category>
                
                    <category>
                        <![CDATA[ terminal ]]>
                    </category>
                
                    <category>
                        <![CDATA[ zsh ]]>
                    </category>
                
                <dc:creator>
                    <![CDATA[ Daniel Kehoe ]]>
                </dc:creator>
                <pubDate>Tue, 09 Jan 2024 20:37:28 +0000</pubDate>
                <media:content url="https://www.freecodecamp.org/news/content/images/2024/07/pexels-mike-468229-1181772.jpg" medium="image" />
                <content:encoded>
                    <![CDATA[ <p>Beginners often get confused when configuring Zsh shell on a Mac.</p>
<p>Zsh shell offers four configuration files with no discernible differences. Particularly, <code>~/.zshrc</code> and <code>~/.zprofile</code> appear to be identical, leaving us wondering which one to use. </p>
<p>In this article, you'll learn the difference and a simple guideline for your shell configuration.</p>
<h2 id="heading-why-do-you-need-configuration">Why Do you Need Configuration?</h2>
<p>For programming on a Mac, the Terminal application is an essential tool in your development environment. The Terminal is a command-line interface (CLI) that allows you to interact with the operating system and run commands. </p>
<p>The Terminal or console gives you access to the Unix command line, or shell. </p>
<p><a target="_blank" href="https://en.wikipedia.org/wiki/Z_shell">Zsh</a>, also known as Z shell, is a program that runs in the Terminal, interprets Unix commands, and interacts with the operating system. Zsh is the default shell program on MacOS.</p>
<p>Before you get started with programming on the Mac, you'll need to configure the shell. There are optional and convenient settings, such as aliases for hard-to-remember commands and a custom prompt that can display the directory you're in, among other things. </p>
<p>There are also some critical environment variables that make programs available or alter shell behavior. The <code>EDITOR</code> environment variable, for example, can set your preferred text editor. Oftentimes, when installing a programming language or software utilities, you need to set the <code>PATH</code> environment variable..</p>
<h2 id="heading-where-to-start">Where to Start</h2>
<p>Zsh configuration files are kept in the user's home directory and are named with a dot as the first character to keep them hidden by default. </p>
<p>Zsh recognizes four different configuration files in the user's home directory: <code>~/.zshenv</code>, <code>~/.zprofile</code>, <code>~/.zshrc</code>, and <code>~/.zlogin</code>. </p>
<p>This is where Zsh configuration becomes puzzling, even for experienced developers. Tutorials rarely explain the differences, especially between the <code>zprofile</code> and <code>zshrc</code> files, leaving curious developers scratching their heads and blindly following instructions.</p>
<h3 id="heading-how-is-the-shell-used">How is the Shell Used?</h3>
<p>To understand the differences among Zsh configuration files, consider various shell uses, which can be classified as interactive or non-interactive, login or non-login sessions.</p>
<ol>
<li>On macOS, each new terminal session is treated as a login shell, so opening any terminal window starts an interactive login session. Also, a system administrator who connects to a remote server via SSH initiates an interactive login session.</li>
<li>If a terminal window is already open and you run the command <code>zsh</code> to start a subshell, it will be interactive and non-login. Beginners rarely use subshells.</li>
<li>Automated shell scripts run without login or any user prompting. These are non-interactive and non-login.</li>
<li>Few people ever encounter a non-interactive login shell session. It requires starting a script with a special flag or piping output of a command into an SSH connection.</li>
</ol>
<h3 id="heading-how-do-the-configuration-files-work">How do the Configuration Files Work?</h3>
<p>These use cases necessitate different shell configurations, which explains why Zsh supports four different configuration files. Here's how the configuration files are used:</p>
<ul>
<li><code>~/.zshenv</code>: This is loaded universally for all types of shell sessions (interactive or non-interactive, login or non-login). It is the only configuration file that gets loaded for non-interactive and non-login scripts like cron jobs. However, macOS overrides this for <code>PATH</code> settings for interactive shells.</li>
<li><code>~/.zprofile</code>: Loaded for login shells (both interactive and the rare non-interactive sessions). MacOS uses this to set up the shell for any new terminal window. Subshells that start within the terminal window inherit settings but don't load <code>~/.zprofile</code> again.</li>
<li><code>~/.zshrc</code>: Loaded only for interactive shell sessions. It is loaded whenever you open a new terminal window or launch a subshell from a terminal window.</li>
<li><code>~/.zlogin</code>: Only used for login shell configurations, loaded after <code>.zprofile</code>. This is loaded whenever you open a new terminal window.</li>
</ul>
<p><img src="https://www.freecodecamp.org/news/content/images/2024/01/zsh-diagram.png" alt="Image" width="600" height="400" loading="lazy"></p>
<h2 id="heading-how-to-use-each-file">How to Use Each File</h2>
<p>With that in mind, let's consider which configuration files you should use.</p>
<ul>
<li><code>~/.zshenv</code>: It is universally loaded, so you could use it to configure the shell for automated processes like cron jobs. However, it is best to explicitly set up environmental variables for automated processes in scripts and leave nothing to chance. As a beginner, you will not use this configuration file. In fact, few experienced macOS developers use it.</li>
<li><code>~/.zprofile</code>: Homebrew recommends setting the <code>PATH</code> variable here. There's a reason <code>PATH</code> should be set in  <code>~/.zprofile</code> and not the universal <code>~/.zshenv</code>file: the macOS runs a utility <code>path_helper</code> (from <code>/etc/zprofile</code>) that sets the <code>PATH</code> order before <code>~/.zprofile</code> is loaded.</li>
<li><code>~/.zshrc</code>: This is the configuration file that most developers use. Use it to set aliases and a custom prompt for the terminal window. You can also use it to set the <code>PATH</code> (which many people do) but <code>~/.zprofile</code> is preferred.</li>
<li><code>~/.zlogin</code>: This is rarely used. Only important in managing the order of initialization tasks for login shells in complex environments. It can be used to display messages or system data.</li>
</ul>
<h2 id="heading-how-to-avoid-complications">How to Avoid Complications</h2>
<p>These configurations may appear complicated. It made sense in the early days of computing to start time-consuming processes at login and not have them repeat when a new terminal was launched.</p>
<p>MacOS now launches any new terminal window as a login shell, loading both  <code>~/.zprofile</code> and <code>~/.zshrc</code> files without concern for the shell startup time. So why not use one Zsh configuration file? A bow to history, plus configuration customization for the experts.</p>
<p>The key advantage of the <code>~/.zprofile</code> file (versus  <code>~/.zshenv</code>) is that it sets environment variables such as <code>PATH</code> without override from macOS. The  <code>~/.zshrc</code> file could be used for the same but, by convention and design, is intended for customizing the look and feel of the interactive terminal.</p>
<h2 id="heading-keep-it-simple">Keep It Simple</h2>
<p>If you're looking for simple guidelines, here's the current best practice.</p>
<ul>
<li>Use <code>~/.zprofile</code> to set the <code>PATH</code> and <code>EDITOR</code> environment variables.</li>
<li>Use <code>~/.zshrc</code> for aliases and a custom prompt, tweaking the appearance and behavior of the terminal.</li>
<li>If you write automated shell scripts, check and set environment variables in the script.</li>
</ul>
<h2 id="heading-more-information">More Information</h2>
<p>I've written other guides that go into detail about the following:</p>
<ul>
<li><a target="_blank" href="https://mac.install.guide/terminal/index.html">Mac Terminal</a></li>
<li><a target="_blank" href="https://mac.install.guide/terminal/configuration.html">Shell Configuration</a></li>
<li><a target="_blank" href="https://mac.install.guide/terminal/path.html">Mac PATH</a>.</li>
</ul>
<p>If you're just getting started, you'll need to know <a target="_blank" href="https://mac.install.guide/terminal/open.html">How to Open Mac Terminal</a> and <a target="_blank" href="https://mac.install.guide/commandlinetools/index.html">Install Xcode Command Line Tools</a>.</p>
<p>Configuring the Zsh shell is a critical step in preparing your Mac development environment. With your development environment set up, you'll be prepared for any tutorial you'll find on freeCodeCamp.</p>
 ]]>
                </content:encoded>
            </item>
        
            <item>
                <title>
                    <![CDATA[ How to Install Xcode Command Line Tools on a Mac ]]>
                </title>
                <description>
                    <![CDATA[ Developers need to install Xcode Command Line Tools before they can develop software on a Mac. Apple provides a complete development environment for programmers named Xcode. If you are developing software for macOS, iOS, tvOS, and watchOS, you must i... ]]>
                </description>
                <link>https://www.freecodecamp.org/news/install-xcode-command-line-tools/</link>
                <guid isPermaLink="false">66ba1609a16d07b8deb68309</guid>
                
                    <category>
                        <![CDATA[ Apple ]]>
                    </category>
                
                    <category>
                        <![CDATA[ command line ]]>
                    </category>
                
                    <category>
                        <![CDATA[ macOS ]]>
                    </category>
                
                    <category>
                        <![CDATA[ software development ]]>
                    </category>
                
                    <category>
                        <![CDATA[ Xcode ]]>
                    </category>
                
                <dc:creator>
                    <![CDATA[ Daniel Kehoe ]]>
                </dc:creator>
                <pubDate>Mon, 19 Jul 2021 22:25:44 +0000</pubDate>
                <media:content url="https://www.freecodecamp.org/news/content/images/2021/07/Terminal_Mac.png" medium="image" />
                <content:encoded>
                    <![CDATA[ <p>Developers need to install Xcode Command Line Tools before they can develop software on a Mac.</p>
<p>Apple provides a complete development environment for programmers named Xcode. If you are developing software for macOS, iOS, tvOS, and watchOS, you must install the full Xcode application. </p>
<p>It's not pre-installed, but you can install it from the <a target="_blank" href="https://developer.apple.com/download/">Apple developer website</a> or the App Store on your Mac.</p>
<h2 id="heading-what-are-xcode-command-line-tools">What are Xcode Command Line Tools?</h2>
<p>If you're not developing software for an Apple device, you won't need the full Xcode application (it requires over 40GB of disk space!).</p>
<p>Instead, you'll install Xcode Command Line Tools. It's a smaller package for software developers with tools that run on the command line, that is, in the Terminal application.</p>
<p>Programmers have used these tools on Unix operating systems since computing's beginnings, and they serve as the foundation of almost all software development. </p>
<p>Luckily, the Xcode Command Line Tools package only requires 1.2GB of space on your disk.</p>
<p>You have three choices to install Xcode Command Line Tools on a Mac:</p>
<ul>
<li>install the full Xcode package</li>
<li>install Xcode Command Line Tools when triggered by a command</li>
<li>install Xcode Command Line Tools as part of a Homebrew installation.</li>
</ul>
<p>I don't recommend installing the full Xcode package unless you're developing software for an Apple device. The download will take too long and it will consume unnecessary disk space. Instead, try either of two faster methods.</p>
<h2 id="heading-how-to-install-xcode-command-line-tools-from-a-command-prompt">How to Install Xcode Command Line Tools from a Command Prompt</h2>
<p>Apple has made it easy to install Xcode Command Line Tools because certain commands will prompt you to begin installation.</p>
<p>Here are examples of commands that will trigger a prompt to install Xcode Command Line Tools:</p>
<ul>
<li><code>clang</code> – a compiler that turns source code into an executable program</li>
<li><code>gcc</code> – the GNU compiler</li>
<li><code>git</code> – the save-as-you-go version control system</li>
</ul>
<p>Running any of these commands in the terminal will bring up a prompt to install Xcode Command Line Tools. I've written elsewhere about <a target="_blank" href="https://mac.install.guide/terminal/index.html">How to Open Terminal on MacOS</a> – just click the Spotlight icon in the menu bar and type “terminal.”</p>
<p>You can also enter the command <code>xcode-select --install</code> in the terminal to begin the installation process. You'll see a panel that asks you to install Xcode Command Line Tools.</p>
<p><img src="https://mac.install.guide/assets/images/ruby/install-Xcode-CLT.png" alt="Image" width="600" height="400" loading="lazy"></p>
<p>Click 'Install' to begin the download and installation process.</p>
<p><img src="https://mac.install.guide/assets/images/ruby/install-Xcode-CLT-progress.png" alt="Image" width="600" height="400" loading="lazy"></p>
<p>Installation takes 8 minutes on a 2021 Mac M1 Mini, with a 100Mbps Internet connection. It's significantly slower on Mac Intel over a slow Internet connection.</p>
<p><img src="https://mac.install.guide/assets/images/ruby/install-Xcode-CLT-done.png" alt="Image" width="600" height="400" loading="lazy"></p>
<p>You'll see a confirmation message when installation is complete.</p>
<p>Verify that you've successfully installed Xcode Command Line Tools:</p>
<pre><code class="lang-bash">$ xcode-select -p
</code></pre>
<p>You should see the following:</p>
<pre><code class="lang-bash">/Library/Developer/CommandLineTools
</code></pre>
<h2 id="heading-how-to-use-homebrew-to-install-xcode-command-line-tools">How to Use Homebrew to Install Xcode Command Line Tools</h2>
<p>As easy as it is to use the command prompt to install Xcode Command Line Tools, I recommend an even easier method: using Homebrew.</p>
<p>This option was only recently added to Homebrew, so many developers are not aware of it.</p>
<p>Homebrew is the popular Mac package manager. Most developers need programming languages and utilities that don't come installed on macOS and are not included in the Xcode Command Line Tools package. Homebrew can install almost any open-source tool for developers.</p>
<p>Since you'll probably need Homebrew, you might as well let Homebrew install Xcode Command Line Tools for you.</p>
<p>First, check if Homebrew is already installed.</p>
<pre><code class="lang-bash">$ brew
</code></pre>
<p>If Homebrew is not installed, you will see:</p>
<pre><code class="lang-bash">zsh: <span class="hljs-built_in">command</span> not found: brew
</code></pre>
<p>Homebrew provides an installation script you can run with a single command (check that it hasn't changed at the <a target="_blank" href="https://brew.sh/">Homebrew site</a>).</p>
<pre><code class="lang-bash">$ /bin/bash -c <span class="hljs-string">"<span class="hljs-subst">$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)</span>"</span>
</code></pre>
<p>The Homebrew installation script will ask you to enter your Mac user password. This is the password you use to sign in to your Mac.</p>
<pre><code class="lang-bash">Password:
</code></pre>
<p>You won't see the characters as you type. Press enter when you are done.</p>
<p><img src="https://mac.install.guide/assets/images/ruby/homebrew-enter-password.png" alt="Image" width="600" height="400" loading="lazy"></p>
<p>If you haven't already installed Xcode Command Line Tools, you'll see a message that "The Xcode Command Line Tools will be installed." Press return to continue when prompted by the Homebrew installation script.</p>
<p><img src="https://mac.install.guide/assets/images/ruby/install-homebrew.png" alt="Image" width="600" height="400" loading="lazy"></p>
<p>You’ll see diagnostic and progress messages. Homebrew installation takes 2 to 15 minutes on a 2021 Mac M1 Mini, with a 100Mbps Internet connection. It's significantly slower on Mac Intel over a slow Internet connection.</p>
<p><img src="https://mac.install.guide/assets/images/ruby/homebrew-complete.png" alt="Image" width="600" height="400" loading="lazy"></p>
<p>On Mac Intel machines, that's all you need to do – Homebrew is ready to use. On Mac Intel, Homebrew installs itself into the <code>/usr/local/bin</code> directory, which is already configured for access by the shell with the macOS default <code>$PATH</code>.</p>
<p>On Apple Silicon machines, there's one more step. Homebrew files are installed into the <code>/opt/homebrew</code> folder. But the folder is not part of the default <code>$PATH</code>. Follow Homebrew's advice and create a <code>~/.zprofile</code> file that contains a command which sets up Homebrew. Homebrew shows instructions at the end of the installation process:</p>
<pre><code class="lang-bash">- Add Homebrew to your PATH <span class="hljs-keyword">in</span> ~/.zprofile:
<span class="hljs-built_in">echo</span> <span class="hljs-string">'eval "$(/opt/homebrew/bin/brew shellenv)"'</span> &gt;&gt; ~/.zprofile
<span class="hljs-built_in">eval</span> <span class="hljs-string">"<span class="hljs-subst">$(/opt/homebrew/bin/brew shellenv)</span>"</span>
</code></pre>
<p>After you've installed Homebrew, check that Homebrew is installed properly.</p>
<pre><code class="lang-bash">$ brew doctor
</code></pre>
<p>You should see this:</p>
<pre><code class="lang-bash">Your system is ready to brew.
</code></pre>
<p>If Homebrew is successfully installed, there will be Homebrew files in <code>/usr/local</code> (for macOS Intel) or <code>/opt/homebrew</code> (for Apple Silicon).</p>
<p>Now you have both Xcode Command Line Tools and Homebrew installed. If you want to learn more about adding Homebrew packages to set up your development environment, see <a target="_blank" href="https://mac.install.guide/homebrew/6.html">Install a Homebrew Package</a>.</p>
<h2 id="heading-more-information">More information</h2>
<p>I've written an in-depth guide to <a target="_blank" href="https://mac.install.guide/commandlinetools/index.html">Install Xcode Command Line Tools</a> that goes beyond these basics. </p>
<p>In the guide, I explain how to check if <a target="_blank" href="https://mac.install.guide/commandlinetools/2.html">Xcode Command Line Tools Are Already Installed</a>. I go into more detail about how to <a target="_blank" href="https://mac.install.guide/commandlinetools/3.html">Install Xcode Command Line Tools with Homebrew</a>. Finally, I explain how to <a target="_blank" href="https://mac.install.guide/commandlinetools/6.html">Uninstall Xcode Command Line Tools</a>, <a target="_blank" href="https://mac.install.guide/commandlinetools/7.html">Reinstall Xcode Command Line Tools</a>, and provide a <a target="_blank" href="https://mac.install.guide/commandlinetools/8.html">List of Xcode Command Line Tools</a> that you can use.</p>
<p>There's also a complete guide to <a target="_blank" href="https://mac.install.guide/homebrew/index.html">Install Homebrew for Mac</a> that explains how to <a target="_blank" href="https://mac.install.guide/homebrew/4.html">Update Homebrew</a>, <a target="_blank" href="https://mac.install.guide/homebrew/5.html">Uninstall Homebrew</a>, and keep up with other <a target="_blank" href="https://mac.install.guide/homebrew/8.html">Housekeeping for Homebrew</a>.</p>
<h2 id="heading-your-development-environment">Your development environment</h2>
<p>MacOS is the most popular platform for software development because the operating system is based on Unix, the longtime standard for software development.</p>
<p>With Xcode Command Line Tools installed, you'll have a solid foundation for adding almost any open source development tool.</p>
<p>Add Homebrew and you have a package manager that can install version managers, programming languages, and almost any other tool you may need.</p>
<p>Combined with a text editor and terminal application, you'll be prepared for any tutorial you'll find on freeCodeCamp.</p>
 ]]>
                </content:encoded>
            </item>
        
            <item>
                <title>
                    <![CDATA[ Don't Use the Mac System Ruby – Use This Instead ]]>
                </title>
                <description>
                    <![CDATA[ Someone may have once told you, "Don't use the system Ruby." It's good advice, but why? Let's find out. Which Ruby do you have? MacOS comes with a "system Ruby" pre-installed. Use the which command to see where Ruby is installed: $ which ruby /usr/bi... ]]>
                </description>
                <link>https://www.freecodecamp.org/news/do-not-use-mac-system-ruby-do-this-instead/</link>
                <guid isPermaLink="false">66ba15fb228e16bed602a8bc</guid>
                
                    <category>
                        <![CDATA[ best practices ]]>
                    </category>
                
                    <category>
                        <![CDATA[ mac ]]>
                    </category>
                
                    <category>
                        <![CDATA[ Ruby ]]>
                    </category>
                
                <dc:creator>
                    <![CDATA[ Daniel Kehoe ]]>
                </dc:creator>
                <pubDate>Wed, 10 Feb 2021 17:27:03 +0000</pubDate>
                <media:content url="https://www.freecodecamp.org/news/content/images/2021/02/photo-1522776851755-3914469f0ca2.jpeg" medium="image" />
                <content:encoded>
                    <![CDATA[ <p>Someone may have once told you, "Don't use the system Ruby." It's good advice, but why? Let's find out.</p>
<h2 id="heading-which-ruby-do-you-have">Which Ruby do you have?</h2>
<p>MacOS comes with a "system Ruby" pre-installed.</p>
<p>Use the <code>which</code> command to see where Ruby is installed:</p>
<pre><code class="lang-bash">$ <span class="hljs-built_in">which</span> ruby
/usr/bin/ruby
</code></pre>
<p>If you see <code>/usr/bin/ruby</code>, it is the pre-installed macOS system Ruby.</p>
<p>It's fine to use the system Ruby for running sysadmin scripts, as long as you don't alter the system Ruby by attempting to update it or add gems. </p>
<p>But you don't want to use it when you are developing projects in Ruby.</p>
<h2 id="heading-ruby-for-development">Ruby for development</h2>
<p>For developing projects with Ruby, you should <a target="_blank" href="https://mac.install.guide/ruby/12.html">Install Ruby with Homebrew</a> or use a version manager such as asdf, chruby, rbenv, or rvm. </p>
<p>A version manager helps if you're juggling multiple projects and can't update all at once. For a guide that compares version managers and shows the best way to install Ruby, see my article <a target="_blank" href="https://mac.install.guide/ruby/index.html">Install Ruby on a Mac</a>.</p>
<p>But why not use the macOS default Ruby? Let's take a look at the reasons why it's a bad idea to use the Mac default Ruby for development.</p>
<h3 id="heading-gem-installation-hassles">Gem installation hassles</h3>
<p>RubyGems are the ready-made software libraries that make development easy and fun in Ruby. Most Ruby projects use at least a few gems.</p>
<p>If you use the Mac system Ruby, running <code>gem install</code> will try to save gems to the system Ruby directory <code>/Library/Ruby/Gems/2.6.0</code>. That directory is owned by <code>root</code>, the system superuser. Ordinary users are not allowed to write to it (and you really shouldn't alter this folder).</p>
<p>If you try to install a gem, for example <code>gem install rails</code>, you'll get a permissions error:</p>
<pre><code class="lang-bash">ERROR: While executing gem ... (Gem::FilePermissionError)
You don<span class="hljs-string">'t have write permissions for the /Library/Ruby/Gems/2.6.0 directory</span>
</code></pre>
<h3 id="heading-it-violates-system-security">It violates system security</h3>
<p>Unix-based systems are powerful, so there's a workaround. You can install gems as a superuser to override the permissions restriction. But don't do this!</p>
<pre><code class="lang-bash">$ sudo gem install rails
</code></pre>
<p>Any time you are about to run <code>sudo</code>, you should stop and ask if you're about to shoot yourself in the foot. </p>
<p>In this case, you need <code>sudo</code> because you're altering system files that are managed by the OS. Don't do it! You may leave the system in a broken or compromised state. Even worse, a gem might contain malicious code that tampers with your computer.</p>
<h3 id="heading-gem-management">Gem management</h3>
<p>Experienced developers use <a target="_blank" href="https://bundler.io/">Bundler</a> to install gems and manage their dependencies. </p>
<p>Imagine you've got projects that use different versions of a gem (maybe there was a new gem release between your projects). Or maybe two different gems in your project rely on different versions of a dependent gem. </p>
<p>Bundler uses a Gemfile in your project directory to keep track of the gems you need. If you were to use <code>sudo</code> to install gems with the system Ruby, you'd end up with a mess of incompatible gems in the system Ruby directory. </p>
<p>You can work around the systems permission problem by <a target="_blank" href="https://bundler.io/doc/troubleshooting.html">installing Bundler</a> with a command that uses your home directory for gems. But it's easier to install Ruby with Homebrew or use a version manager and use the Bundler that comes installed, which will correctly set up your local development environment.</p>
<h3 id="heading-use-the-newest-ruby">Use the newest Ruby</h3>
<p>When you start a project, use the newest Ruby release (it's 3.0 at the time this was written). </p>
<p>The system Ruby in macOS Catalina or Big Sur is Ruby 2.6.3, which is old. If you're just starting with Ruby, install with Homebrew and work on a project with Ruby 3.0. When you start building another project, it may be time to install a version manager so you can juggle projects with different Ruby versions.</p>
<h2 id="heading-macos-after-big-sur">MacOS after Big Sur</h2>
<p>MacOS Big Sur is now the current version. <a target="_blank" href="https://developer.apple.com/documentation/macos-release-notes/macos-catalina-10_15-release-notes">Apple says</a>:</p>
<blockquote>
<p><em>"Scripting language runtimes such as Python, Ruby, and Perl are included in macOS for compatibility with legacy software. Future versions of macOS won’t include scripting language runtimes by default, and might require you to install additional packages."</em></p>
</blockquote>
<p>If you're reading this at the end of 2021, the system Ruby may already be gone. If not, prepare yourself by installing Ruby with Homebrew or a version manager. </p>
<h2 id="heading-enjoy-ruby">Enjoy Ruby</h2>
<p>For developers planning to build web applications with Rails, I've written a guide, <a target="_blank" href="https://learn-rails.com/install-rails-mac/index.html">Install Rails on a Mac</a>, which goes beyond <a target="_blank" href="https://mac.install.guide/ruby/index.html">Install Ruby on a Mac</a> to show how to pick a version manager that will work with Node as well as Ruby.</p>
<p>Enjoy the pleasure of coding in Ruby! After all, it is known as a language dedicated to programmer happiness. But remember, the system Ruby is there for macOS, not for you.</p>
 ]]>
                </content:encoded>
            </item>
        
    </channel>
</rss>
