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 installed is an app you can run as is, so just move it into your Mac’s Applications folder.
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.
With this, when you write Python programs in VS Code you can use jupyter, get automatic syntax highlighting, and generally have a working Python development environment.
Checking that it actually works
Create a file called test.py in any directory you like.
Create a new file, choose text, and specify Python as the language.
Then name it test.py and enter the following into the program:
print(“Hello World!!”)
Enter that.
Then run it with the play button in the upper right.
Hello World!! will then be displayed in the terminal below.
Once you get this far, your Python development environment is up and running.
If you’ve created a virtual environment with Anaconda, you can select the environment you want from the Python interpreter selector in the lower right.
Alternatively, you can activate the virtual environment with the conda command in the terminal.