This article was automatically translated from Japanese using AI. The Japanese version is the authoritative version.
I decided to set up a Python development environment on my Mac, so here are my notes for future reference.
Installing Visual Studio Code (VS Code)
Install the app from the Visual Studio Code website.
What gets downloaded is an app you can run as is, so just move it into the Applications folder on your Mac.
Switching VS Code to Japanese
Install the “Japanese Language Pack for Visual Studio Code”.
Select Extensions from the menu bar on the left and type “Japanese Language Pack for Visual Studio Code”.
Then install the package with that same name that appears at the top of the list.
After that, restart VS Code and check that the interface is now in Japanese.
Installing the Python extension
Next, install the Python extension in the same way.
Select Extensions from the menu bar on the left, type “Python,” and install Python.
This sets up a Python development environment: you can use Jupyter when writing Python programs in VS Code, and the syntax is automatically recognized and color-coded.
Checking that it actually works
Create a file called test.py in any directory you like.
Create a new file, choose a text file, and specify Python as the language.
Then name it test.py and enter the following program:
print(“Hello World!!”)
Type that in.
Then run it with the play button in the upper right.
Hello World!! will be printed in the terminal below.
Once you get this far, your Python development environment is up and running.
If you have set up virtual environments with Anaconda, you can select the one you want from the Python interpreter selector in the lower right.
Alternatively, you can activate a virtual environment with the conda command in the terminal.