Skip to Content
エクセルのためのPython (Japanese Edition), 2nd Edition
book

エクセルのためのPython (Japanese Edition), 2nd Edition

by Felix Zumstein
May 2026
Intermediate
418 pages
6h 42m
Japanese
O'Reilly Media, Inc.
Content preview from エクセルのためのPython (Japanese Edition), 2nd Edition

第2章 開発 環境

この作品はAIを使って翻訳されている。ご意見、ご感想をお待ちしている:translation-feedback@oreilly.com

VBAコードを書くには、Excelを起動してVBAエディタを開けば十分だ。Pythonをフルにインストールして使うには、もう少し手間がかかる。もし本書がExcelでのPython(第III部)とxlwings Lite(第V部)だけを取り扱うものであれば、ローカルに何もインストールする必要はなかっただろう。 しかし、ExcelからPythonを使うことは物語の片側しかカバーしていない。もう一方の側面、つまりPythonからExcelを使うこと(第4部および第6部)も見逃したくない。 さらに、ExcelでのPython利用もxlwings Liteも、完全なPython環境にはない特定の制限がある。この章では、Python開発者として必要なすべてのツールに慣れることになる。まずは、最も基本的なプログラミングツールであるターミナルの簡単な導入部から始める。 続いて、最新のパッケージマネージャーであるuvをインストールし、それを用いてPython本体をインストールする。Pythonのインストールが完了したら、 のJupyterノートブックとVisual Studio Code(VS Code)で最初のコードスニペットを実行する。Jupyterノートブックを使えば、データ、コード、グラフをインタラクティブに操作できるため、Excelワークブックの強力な競合相手となる。 VS Code は、Pythonコードの記述、実行、デバッグに最適な強力なテキストエディターだ。本書はExcelに関するものなので、この章ではWindowsとmacOSに焦点を当てる。何よりもまず、付属のリポジトリをダウンロードしよう!

付属リポジトリ

『』をインストールし、Python をセットアップして本書の例題を実行するには、まずGitHub から付属のリポジトリをダウンロードする必要がある。図 2-1 に示すように、緑色の「Code」ボタンをクリックし、「Download ZIP」を選択する。

これにより、python-for-excel-2e.zipというファイルがダウンロードされる。ダウンロードが完了したら、お使いのオペレーティングシステムの手順に従って、ZIPファイルをユーザディレクトリに解凍する。

Screenshot of a GitHub repository page showing the option to download a ZIP file by clicking the green "Code" button and selecting "Download ZIP."
図2-1. コンパニオンリポジトリのダウンロード

手順を正確に実行してほしい

ZIPファイルを正確に抽出するために、以下の手順に従ってほしい。これにより、コンパニオンリポジトリが正しいフォルダに配置されることが保証される。

Windows

ダウンロードした ZIP ファイルを右クリックし、「すべて抽出」を選択する。ダイアログボックスで、ユーザディレクトリのみが表示されるようにパスを変更する(私の場合はC:\Users\felix)。その後、「抽出」をクリックする(図 2-2 を参照)。これで、ユーザディレクトリ(C:\Users\<USERNAME>\python-for-excel-2e)にコンパニオンリポジトリが準備された。

macOS

のFinderで、ZIPファイルをダブルクリックし、python-for-excel-2e ...

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.

Read now

Unlock full access

More than 5,000 organizations count on O’Reilly

AirBnbBlueOriginElectronic ArtsHomeDepotNasdaqRakutenTata Consultancy Services

QuotationMarkO’Reilly covers everything we've got, with content to help us build a world-class technology community, upgrade the capabilities and competencies of our teams, and improve overall team performance as well as their engagement.
Julian F.
Head of Cybersecurity
QuotationMarkI wanted to learn C and C++, but it didn't click for me until I picked up an O'Reilly book. When I went on the O’Reilly platform, I was astonished to find all the books there, plus live events and sandboxes so you could play around with the technology.
Addison B.
Field Engineer
QuotationMarkI’ve been on the O’Reilly platform for more than eight years. I use a couple of learning platforms, but I'm on O'Reilly more than anybody else. When you're there, you start learning. I'm never disappointed.
Amir M.
Data Platform Tech Lead
QuotationMarkI'm always learning. So when I got on to O'Reilly, I was like a kid in a candy store. There are playlists. There are answers. There's on-demand training. It's worth its weight in gold, in terms of what it allows me to do.
Mark W.
Embedded Software Engineer

You might also like

大規模言語モデル:難しい部分 (Japanese Edition)

大規模言語モデル:難しい部分 (Japanese Edition)

Thársis T. P. Souza, Jonathan K. Regenstein

Publisher Resources

ISBN: 0642572395971