【Python】自作パッケージをpipで管理by あずみに pip、Pythonon 投稿日: 2017年1月25日 【Python】自作パッケージをpipで管理する方法です。 はじめにパッケージ用の適当なディレクトリを作ってその中にsetup.pyを用意します。 今回はpackageというディレクトリ名にします。 This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters Show hidden characters from distutils.core import setup setup(name='package', version='1.0', description='My Package', ) view raw setup.py hosted with by GitHub View the code on Gist. 次に以下のコマンドを打ちます。 pip install -e package pip installの-eオプションは–editableと書くこともできます。 これでpackageディレクトリ内のファイルがpipの管理下に入りました。 あとはpackageディレクトリ内に自作のモジュールを放り込めばどこからでもモジュールをインポートできるようになります。