0% found this document useful (0 votes)
32 views2 pages

Install Python and PyCharm on MacOS

This document provides instructions for installing Python 3, PyCharm, Xcode, and Homebrew on MacOS. It outlines downloading and installing each program, including verifying the Python version, installing Xcode command line tools with Homebrew, updating the bash profile, and testing the Python and PyCharm installations. The summary is completed by creating a new PyCharm project and verifying that Python 3.7 is set as the project interpreter by running a simple "Hello World" script.

Uploaded by

Arun Kapania
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
32 views2 pages

Install Python and PyCharm on MacOS

This document provides instructions for installing Python 3, PyCharm, Xcode, and Homebrew on MacOS. It outlines downloading and installing each program, including verifying the Python version, installing Xcode command line tools with Homebrew, updating the bash profile, and testing the Python and PyCharm installations. The summary is completed by creating a new PyCharm project and verifying that Python 3.7 is set as the project interpreter by running a simple "Hello World" script.

Uploaded by

Arun Kapania
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

Install Python and PyCharm on MacOS

I show in this video how to install both Python 3 as well as Pycharm on MacOS. I’m using the
free Community version of PyCharm. This course doesn’t require you to use PyCharm however.
Feel free to use any IDE.

Installation Steps

Verify Python Version Installed

1. We’ll need the Terminal application

2. Open your Applications folder

3. Open the Utilities folder

4. Double click to open the Terminal application

5. Type python -v in the Terminal program and if Python version 2.7 is installed you’ll need to
install Python 3

6. Type quit() to exit Python in your Terminal

Install Xcode

1. You’ll need to open up your App Store to install Xcode if you don’t have it

2. Search for Xcode and click Install or Update

3. After Xcode installs open your Terminal

4. You need to type Xcode-select — install to install the Command Line Tools

Install Homebrew

1. Go to [Link]

2. Copy the command that starts with /usr/bin/ruby… (Get all the Code)

3. Open your Terminal and paste that command in

Update your Bash Profile

1. Open your users folder

2. Click the following keys at the same time command + Shift + .

3. This displays hidden files

4. Open .bash_profile

5. Put the following line in that file and save the .bash_profile file

1. Export PATH=“/usr/local/opt/python/libexec/bin:$PATH”

6. Click command + Shift + . To hide hidden files

Install Python 3 with Homebrew

1. Open your Terminal and type brew install python

2. After that installs type python3

3. You should see Python 3.7 as your version of Python

4. Test installation by typing print(“Hello World”)

5. Type quit() to exit Python in the Terminal

Install PyCharm

1. Go to jet [Link]/pycharm and click DOWNLOAD

2. Click on DOWNLOAD under the Community (Free) version

3. Open the DMG file that downloads

4. Drag the PyCharm file into your Applications folder

Setup PyCharm

1. Open PyCharm from your Applications folder

2. Select Do not import settings and click OK

3. Confirm you read the User Agreement and click Continue

4. Decide if you want to share data

5. Select that you have never used PyCharm and click Next

6. Select Dark or Light theme and click Next

7. Select that you want to Create a script for opening files

8. Don’t install either IdeaVim or Markdown and click Start using PyCharm

Test PyCharm Installation

1. When PyCharm opens click Create New Project

2. Name your project, define where to save it, check that you are using the Python 3.7
interpreter under Base interpreter and click Create

3. Click PyCharm and Preferences

4. Click Project: <Your Project Name> -> Project Interpreter

5. Verify that you are using Python 3.7 for the Project Interpreter

6. Right click your project folder in the left sidebar and click New -> Python File

7. Type HelloWorld as you file name and click Python file

8. Type print(“Hello World”) and click Run -> Run in the menu

9. Hit Enter when the little window pops up

10. If you want your console window on the right, right click it and select Move to -> Right
Bottom

That’s it. Everything is installed and you’re ready to start writing some Python programs.

Common questions

Powered by AI

Updating the bash profile is important during the Python 3 installation on MacOS because it configures the system's PATH environment variable. By adding 'Export PATH="/usr/local/opt/python/libexec/bin:$PATH"' to .bash_profile, it ensures that the shell uses the correct version of Python from the Homebrew installation when a Python command is run .

Xcode is essential in setting up a Python development environment on MacOS because it provides the required Command Line Tools needed by compilers and libraries to function correctly. Without these tools, certain dependencies necessary for Python packages and extensions may not compile properly, which can lead to difficulties in Python development .

To customize the layout of the console window in PyCharm, right-click the console window and select 'Move to -> Right Bottom'. Customizing the layout is useful for personalizing your workspace to match your workflow preferences, enhancing visibility and accessibility tailored to individual coding practices .

After downloading PyCharm, open the downloaded DMG file and drag PyCharm into the Applications folder. Open PyCharm, select 'Do not import settings', confirm you agree with the User Agreement, and choose whether to share data. Select your user experience level with PyCharm, choose a theme, and decide on creating a script for file opening. Do not install additional plugins like IdeaVim or Markdown, and click 'Start using PyCharm' to complete the setup .

To test the Python 3 installation, you should type 'python3' in the Terminal to confirm the version is 3.7. Then, you can test the functionality by typing 'print("Hello World")' and ensure that the command executes without errors. These steps are necessary to verify that Python has been installed correctly and is functioning as expected .

Verifying and selecting the correct project interpreter in PyCharm ensures that your code is executed in the intended Python environment, which is critical for maintaining compatibility with your project's dependencies and avoiding runtime errors. This practice prevents issues that arise from conflicts between different versions of packages or Python itself, thus enhancing coding efficiency and reliability .

Selecting the Python 3.7 interpreter during the PyCharm project setup is significant because it ensures that your projects are compatible with the Python version installed on your system. It guarantees that all the Python code you write in PyCharm will be executed by the correct version of the interpreter, thus avoiding compatibility issues and leveraging the new features and improvements of Python 3.7 .

To install Homebrew on MacOS, you need to visit the Homebrew website at brew.sh, copy the command that starts with '/usr/bin/ruby...', open your Terminal, and paste and execute this command. Homebrew is crucial for installing Python 3 as it simplifies the process by managing software installations and dependencies on MacOS systems .

It is recommended to avoid installing IdeaVim and Markdown plugins during the initial PyCharm setup to keep the environment simple and reduce potential distractions for beginners. This approach focuses on familiarizing users with the basic IDE functions before exploring advanced features and additional configurations .

Before installing Python 3 on MacOS, you need to verify the current Python version using the Terminal application. Open the Terminal by navigating to the Applications folder, then the Utilities folder, and double-clicking on the Terminal application. In the Terminal program, you should type 'python -v'. If the version indicates Python 2.7, proceed with installing Python 3 .

You might also like