<?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" version="2.0" xmlns:media="http://search.yahoo.com/mrss/"><channel><title><![CDATA[python-on-macOS - The ServerHub Blog]]></title><description><![CDATA[We are a skilled group of Internet Nerds, with a wild passion for bettering the internet. Here we share our thoughts, ideas, aspirations, and even challenges of running a global platform.]]></description><link>https://blog.serverhub.com/</link><generator>Ghost 0.7</generator><lastBuildDate>Sat, 04 Apr 2026 13:58:28 GMT</lastBuildDate><atom:link href="https://blog.serverhub.com/tag/python-on-macos/rss/" rel="self" type="application/rss+xml"/><ttl>60</ttl><item><title><![CDATA[How to Download, Install & Configure Python on macOS and Ubuntu]]></title><description><![CDATA[Read ServerHub’s guide on how to download, install and configure Python on the latest versions of macOS and Ubuntu operating systems.]]></description><link>https://blog.serverhub.com/how-to-download-install/</link><guid isPermaLink="false">ac8918da-3ca9-437f-8577-a244c41afd12</guid><category><![CDATA[how-to-guide]]></category><category><![CDATA[python]]></category><category><![CDATA[python-on-macOS]]></category><category><![CDATA[Python-on-Ubuntu]]></category><category><![CDATA[How-to-download-Phyton]]></category><dc:creator><![CDATA[Terence Patrick F. Casquejo]]></dc:creator><pubDate>Fri, 19 May 2023 14:06:24 GMT</pubDate><media:content url="http://blog.serverhub.com/content/images/2023/05/Python-on-mac-blog-cover---Blog.png" medium="image"/><content:encoded><![CDATA[<img src="http://blog.serverhub.com/content/images/2023/05/Python-on-mac-blog-cover---Blog.png" alt="How to Download, Install & Configure Python on macOS and Ubuntu"><p>Python is a general-purpose programming language used for web development, desktop and business applications, and other applications. Python 3.11 is the latest release version as of April 2023.</p>

<p>In this guide, you will learn how to install Python 3 on Mac and Ubuntu, and how to download and configure it. Ubuntu 22.10 and macOS 13.3 are the latest versions covered in this article. <br>
<br>  </p>

<h4 id="formacosbr"><strong>For macOS</strong><br></h4>

<h6 id="howtodownloadpythonformacbr"><strong>How to download Python for Mac</strong><br></h6>

<ol>
<li>Go to the official <a href="http://www.python.org/downloads/">Python download</a> website.  </li>
<li>Below the download button, click on Python for macOS. <br>
<img src="https://blog.serverhub.com/content/images/2023/05/Download-latest-version-for-macOS---Blog-1.png" alt="How to Download, Install & Configure Python on macOS and Ubuntu">
<br>  </li>
<li>In the Python Releases for macOS page, click to download the latest Python 3 version installer. <br>
<img src="https://blog.serverhub.com/content/images/2023/05/Python-Releases-for-macOS---Blog.png" alt="How to Download, Install & Configure Python on macOS and Ubuntu"></li>
</ol>

<h6 id="howtoinstallpythononmacbr"><strong>How to install Python on Mac</strong><br></h6>

<ol>
<li><p>When the download is complete, double-click on the download package (.pkg) to begin the installation. Follow the instructions on how to install Python 3 on Mac. <br>
<img src="https://blog.serverhub.com/content/images/2023/05/Python-download-package--pkg----Blog.png" alt="How to Download, Install & Configure Python on macOS and Ubuntu"></p></li>
<li><p>To check if Python 3.11 is installed, enter the following command: <br>
<code>python3 --version</code><br>
You should see the following output: <br>
<code>Python 3.11.0</code><br></p></li>
</ol>

<h6 id="howtoconfigurepythonformacbr"><strong>How to configure Python for Mac</strong><br></h6>

<p>The main process on how to configure Python on Mac is by installing a package manager, which is a tool to manage Python packages and libraries. One of the most popular package managers is "pip". <br>
1. To install the pip3 package manager, open the Terminal app. Enter the following command: <br>
<code>sudo easy_install3 pip</code><br>
2. After pip is installed, use it to install the Python packages or libraries. To install a package, run this command: <br>
<code>pip install &lt;package name&gt;</code><br>
3. Replace the package name with the package you want to install. For example, to install the NumPy library, type the following command: <br>
<code>pip install numpy</code><br>
You can use this method to install other packages. <br>
<br>  </p>

<h4 id="forubuntubr"><strong>For Ubuntu</strong><br></h4>

<h6 id="howtodownloadpythonforubuntubr"><strong>How to download Python for Ubuntu</strong><br></h6>

<ol>
<li>Open the Terminal by pressing <strong>Ctrl + Alt + T</strong> on your keyboard.  </li>
<li>Update your local system's repository by entering the following command: <br>
<code>sudo apt update</code><br></li>
<li>Install the required dependencies to build Python by running this command: <br>
<code>sudo apt install build-essential zlib1g-dev libncurses5-dev libgdbm-dev libnss3-dev libssl-dev libreadline-dev libffi-dev wget</code><br></li>
<li>Download the Python 3.11 source code from the official website using the following command: <br>
<code>wget https://www.python.org/ftp/python/3.11.0/Python-3.11.0.tgz</code></li>
<li>Extract the downloaded archive with this command: <br>
<code>tar -xf Python-3.11.0.tgz</code><br>
After the archive is extracted, the next steps will be how to install Python on Ubuntu.</li>
</ol>

<h6 id="howtoinstallpythononubuntubr"><strong>How to install Python on Ubuntu</strong><br></h6>

<ol>
<li>Go to the extracted directory with this command: <br>
<code>cd Python-3.11.0</code><br></li>
<li>Configure the build by entering the following command <br>
<code>./configure --enable-optimizations</code><br></li>
<li>Build and install Python using the command below: <br>
<code>make -j $(nproc)</code><br>
<code>sudo make altinstall</code><br>
<strong>Note:</strong> The 'altinstall' command is used instead of  to avoid overwriting the default system Python installation.</li>
<li>To verify if Python 3.11 is installed, run the following command: <br>
<code>python3.11 --version</code><br></li>
</ol>

<h6 id="howtoconfigurepythonforubuntubr"><strong>How to configure Python for Ubuntu</strong><br></h6>

<p>Configuring Python generally involves setting up the default version, creating a virtual environment, and installing necessary modules or packages.</p>

<p><strong>Setting a new default version</strong><br>
By default, Python 3.9 is pre-installed on Ubuntu 22.10. Follow these steps to change the Python version in Ubuntu: <br>
1. Open the Terminal app. Run the following command: <br>
<code>sudo update-alternatives --install /usr/bin/python python /usr/bin/python3.9 2</code><br>
2. To set Python 3.11 as the default version, run this command: <br>
<code>sudo update-alternatives --install /usr/bin/python3 python3 /usr/bin/python3.11 1</code><br>
This will prompt the system to use Python 3.11 when you run "python3" in the Terminal. Use this method for updated versions that you will install in your system.</p>

<p><strong>Creating a virtual environment and installing a module</strong><br>
1. Open the Terminal app. Run the following command: <br>
<code>python3.11 -m venv myenv</code><br>
This creates a new virtual environment named 'myenv' in the current directory. <br>
2. To activate the virtual environment, run the following command: <br>
<code>source myenv/bin/activate</code><br>
This changes your prompt to indicate that you are now working inside the virtual environment. <br>
3. To install a module, type the command below: <br>
<code>pip install &lt;module-name&gt;</code><br>
For example, to install the 'numpy' module, run this command: <br>
<code>pip install numpy</code>
4. When you finish working in the virtual environment, deactivate it by running this command: <br>
<code>deactivate</code><br></p>

<p><strong>Note:</strong><br>
Since Ubuntu is a Linux distribution, the steps to install Python on Ubuntu are similar to how to install Python on Linux distributions. The similarities also apply to downloading and configuring Python on other distributions. However, there are some differences depending on the specific distribution and version. Therefore, when downloading, installing, and configuring Python on a specific Linux distribution, refer to the official guide of that distribution.<br></p>

<h4 id="referencesbr"><strong>References</strong><br></h4>

<ol>
<li><a href="https://blog.serverhub.com/how-to-download-install/**https://www.codecademy.com/resources/blog/what-is-python-used-for/**">What Is Python Used For?</a>  </li>
<li><a href="https://pythontest.com/python/installing-python-3-11/">Installing Python 3.11 on Mac or Windows</a>  </li>
<li><a href="https://docs.python.org/3/using/index.html">Python Setup and Usage</a>  </li>
<li><a href="https://linuxhint.com/install-python-ubuntu-22-04/">How to Install Python on Ubuntu 22?</a></li>
</ol>

<script type="application/ld+json">  
{
  "@context": "schema.org",
  "@type": "FAQPage",
  "mainEntity": [{
    "@type": "Question",
    "name": "How to download Python for Mac",
    "acceptedAnswer": {
      "@type": "Answer",
      "text": "Go to the official Python download website. 
Below the download button, click on Python for macOS.  
(Download latest version of Python)
In the Python Releases for macOS page, click to download the latest Python 3 version installer.  
(Python Releases for macOS)"
    }
  },{
    "@type": "Question",
    "name": "How to install Python on Mac",
    "acceptedAnswer": {
      "@type": "Answer",
      "text": "When the download is complete, double-click on the download package (.pkg) to begin the installation. Follow the instructions on how to install Python 3 on Mac.
(Download Python for macOS)
To check if Python 3.11 is installed, enter the following command:  
python3 --version  
You should see the following output:  
Python 3.11.0"  
    }
  },{
    "@type": "Question",
    "name": "How to configure Python for Mac",
    "acceptedAnswer": {
      "@type": "Answer",
      "text": "A main process to configure Python on Mac is by installing a package manager, which is a tool to manage Python packages and libraries. One of the most popular package managers is “pip”. 

To install the pip3 package manager, open the Terminal app. Enter the following command:  
sudo easy_install3 pip  
After pip is installed, use it to install the Python packages or libraries. To install a package, run this command:  
pip install <package-name>  
Replace the package name with the package you want to install. For example, to install the NumPy library, type the following command:  
pip install numpy  
You can use this method to install other packages."  
    }
  },{
    "@type": "Question",
    "name": "How to download Python for Ubuntu",
    "acceptedAnswer": {
      "@type": "Answer",
      "text": "Open the Terminal by pressing Ctrl + Alt + T on your keyboard.
Update your local system’s repository by entering the following command:  
sudo apt update  
Install the required dependencies to build Python by running this command:  
sudo apt install build-essential zlib1g-dev libncurses5-dev libgdbm-dev libnss3-dev libssl-dev libreadline-dev libffi-dev wget  
Download the Python 3.11 source code from the official website using the following command:  
wget <a href="https://www.python.org/ftp/python/3.11.0/Python-3.11.0.tgz">https://www.python.org/ftp/python/3.11.0/Python-3.11.0.tgz</a>  
Extract the downloaded archive with this command:  
tar -xf Python-3.11.0.tgz  
After the archive is extracted, the next steps will be how to install Python on Ubuntu."  
    }
  },{
    "@type": "Question",
    "name": "How to install Python on Ubuntu",
    "acceptedAnswer": {
      "@type": "Answer",
      "text": "Go to the extracted directory with this command:
cd Python-3.11.0

Configure the build by entering the following command:  
./configure --enable-optimizations
Build and install Python using the command below:  
make -j $(nproc)  
sudo make altinstall  
Note: The ‘altinstall’ command is used instead of ‘install’ to avoid overwriting the default system Python installation.  
To verify if Python 3.11 is installed, run the following command:  
python3.11 --version"  
    }
  },{
    "@type": "Question",
    "name": "How to configure Python for Ubuntu",
    "acceptedAnswer": {
      "@type": "Answer",
      "text": "Setting a new default version
By default, Python 3.9 is pre-installed on Ubuntu 22.10. Follow these steps to change the Python version in Ubuntu:  
Open the Terminal app. Run the following command:  
sudo update-alternatives --install /usr/bin/python python /usr/bin/python3.9 2  
To set Python 3.11 as the default version, run this command:  
sudo update-alternatives --install /usr/bin/python3 python3 /usr/bin/python3.11 1  
This will prompt the system to use Python 3.11 when you run “python3” in the Terminal. Use this method for updated versions that you’ll install in your system.

Creating a virtual environment and installing a module  
Open the Terminal app. Run the following command:  
python3.11 -m venv myenv  
This creates a new virtual environment named “myenv” in the current directory.  
To activate the virtual environment, run the following command:  
source myenv/bin/activate  
This changes your prompt to indicate that you’re now working inside the virtual environment.  
To install a module, type the command below:  
pip install <module-name>  
For example, to install the ‘numpy’ module, run this command:  
pip install numpy  
When you finish working in the virtual environment, deactivate it by running this command:  
deactivate"  
    }
  }]
}
</script>]]></content:encoded></item></channel></rss>