秋山です。 Pythonに限った話ではないですが、プログラミングをしていると、使っているライブラリのバージョンを変えたいけど別のライブラリとの依存関係があって難しい…みたいなことってありますよね。 こういったバージョン由来のトラブルやつらみをある程度カバーして助けてくれるのが、仮想環境とパッケージ管理です。 仮想環境とパッケージ管理を使いこなせるようになれば、少なくとも「バージョンの依存関係であっちを入れたらこっちが動かなくなった!」とか「Pythonのバージョンを上げたらこっちのパッケージが動かなくなった!」みたいなトラブルからは解放されます。 今回はPython初心者向けに、仮想環境とは何ぞという話と、venvとpipを使った標準的なPythonにおけるパッケージ管理方法、さらにPipenvを使ってもう少し楽に管理する方法などについて書いていきます。 ■venvとpipを使ってみる P