[Python] To get started with Python, you must first make sure you can use Python.

Conclusion

Install Python on your Mac so you can use it. Python2 series is originally installed on Mac, but this time Python3 series is installed.

background

To get started with Python, you must first be able to use Python. The first thing that stumbles when you start programming is building an environment. I wanted to write a procedure that would be helpful for anyone who wants to get started with Python. Since it is for beginners, I do not think about complicated things such as installing it in a virtual environment.

Overall flow

① Learn command operations ② Install Python

Learn command operations

Learn Mac command operations before installing Python. You can do this a little and programming will be fun.

ls    #Show inside the folder
ls -a  #Show all files and folders, including hidden files
cd    #Move folders
pwd   #Show folder path
touch  #Create an empty file
mkdir  #Create a folder
mv    #Move folders and files
cp    #make a copy
rm    #Delete file
rm -r  #Delete the folder
open   #Open file

For the time being, I think that if you remember this much, you can operate it somehow.

Install python

  1. Download Python from the official website.

https://www.python.org/downloads/

After successful installation, enter the following command in the terminal. OK if the installed Python version is displayed.

python3 --version

  1. Set PATH (pass through PATH)

Check .bash_profile (hidden file directly under your home directory). The following content should be described. If not, create a file and write in the same way. (Pass through PATH)

# Setting PATH for Python 3.8
# The original version is saved in .bash_profile.pysave
PATH="/Library/Frameworks/Python.framework/Versions/3.8/bin:${PATH}"
export PATH

Describe the following in .bashrc. If not, create a file and write in the same way.

alias python=python3
alias pip=pip3

In addition, add the following to .bash_profile.

#.For reading bashrc
source ~/.bashrc

Now you can put it in your PATH. Since Python 2 system is installed on Mac, future development will be smooth if you pass it through PATH. You will be able to run it in Python without having to enter Python 3 each time.

Summary

The first thing that stumbles in programming is environment construction. I think I'll stumble when I go through the PATH. I haven't written the details this time, but I'd like you to follow the procedure anyway. If you can do this, you can start Python.

Referenced information

-Mac Terminal Command List (Basic) -[Python3] Summary of steps to install the latest version of Python on a clean Mac

Recommended Posts

[Python] To get started with Python, you must first make sure you can use Python.
Link to get started with python
How to get started with Python
Until you can use opencv with python
A layman wants to get started with Python
[Cloud102] # 1 Get Started with Python (Part 1 Python First Steps)
If you want to make a discord bot with python, let's use a framework
[First API] Try to get Qiita articles with Python
I tried to get started with blender python script_Part 01
I tried to get started with blender python script_Part 02
Site notes to help you use NetworkX with Python
Get started with Python! ~ ② Grammar ~
❤️ Bloggers ❤️ "Beloved BI" ❤️ Let's get started ❤️ (For those who can make charts with Python)
Solution when you want to use cv_bridge with python3 (virtualenv)
The first API to make with python Djnago REST framework
Minimum knowledge to get started with the Python logging module
[Free to use] 7 learning sites where you can study Python
Python: How to use async with
Get started with Python! ~ ① Environment construction ~
Nice to meet you with python
How to get started with Scrapy
How to get started with Django
How to use FTP with Python
Get started with Python in Blender
Python | What you can do with Python
If you know Python, you can make a web application with Django
A note on what you did to use Flycheck with Python
[Python] A memo that I tried to get started with asyncio
I wrote a script to get you started with AtCoder fast!
Throw something to Kinesis with python and make sure it's in
Step notes to get started with django
I tried to get started with Hy
Fractal to make and play with Python
[Introduction to Python] Let's use foreach with Python
Get Started with TopCoder in Python (2020 Edition)
How Python beginners get started with Python with Progete
How to get started with laravel (Linux)
[Blender x Python] Let's get started with Blender Python !!
[AWS] [GCP] I tried to make cloud services easy to use with Python
Coursera's TensorFlow introductory course to get you started with Deep Learning implementations
Python hand play (let's get started with AtCoder?)
How to get started with the 2020 Python project (windows wsl and mac standardization)
The easiest way to get started with Django
I want to use MATLAB feval with python
Introduction to Tornado (1): Python web framework started with Tornado
Specify the Python executable to use with virtualenv
I want to make a game with Python
Personal best practice template to use when you want to make MVP with Flask
You can easily create a GUI with Python
[Bash] Use here-documents to get python power from bash
I tried to get CloudWatch data with Python
Try to make a "cryptanalysis" cipher with Python
For those who want to learn Excel VBA and get started with Python
The easiest way to use OpenCV with python
I want to use Temporary Directory with Python2
5 Reasons Processing is Useful for Those Who Want to Get Started with Python
[python] [vscode] When you get angry with space-tab-mixed
How to use tkinter with python in pyenv
What to do if you get an error when installing python with pyenv
Try to make a dihedral group with Python
Get started with Python on macOS Big Sur