Installing Python3.10.x Version on Mac and Set the Environment

MacOS already comes with Python2.7 and Python3.8 pre-installed. For specific reasons, I needed to install Python3.10.x separately. After installing the new Python version, some modifications to the default environment settings are required. This article serves as a memo detailing how to modify the environment settings after installing Python3.10 on a Mac. Steps for Installing Python3.10.x and Modifying Environment Settings: 1. Install Python3.10.x 2. Configure environment variables for Python3.10.x

Install Python3.10.x

1. Download Python Go to the Python official website's download page, find the corresponding version, and proceed with the download. For the purpose of this article, I will be downloading Python3.10.6 as an example. Python download page 2. Scroll down to the bottom of the page and look for "Looking for a specific release?" Tips: Use Ctrl+F to search for the Python version number you wish to download. Python3.10.6 3. Navigate to the Python3.10.6 download page. Python3.10.6 download 4. Double click Install program to install Python3.10.6

Configuring Environment Variables for Python3.10.x

1.  Open the Terminal app, and edit “bash_profile”
open ~/.bash_profile
Open the bash_profile file in the default editor on a Mac
edit bash profile bash profile
  2. Configuring Environment Variables Copy and paste following code into the bash_profile
PATH="/Library/Frameworks/Python.framework/Versions/3.10/bin:${PATH}"
export PATH
alias python="/Library/Frameworks/Python.framework/Versions/3.10/bin/python3.10"
bash_profile 3. Make the modified bash_profile file effective
source ~/.bash_profile

Comments

Popular posts from this blog

Maigret: searches for information leaks via usernames [Github]

Adding Specific Applications to Windows 11 Startup Apps