LoginSignup
10
5

More than 3 years have passed since last update.

RubyistのためのPython環境ツール比較早見表

Posted at

はじめに

Pythonのバージョン/ライブラリ管理は色々あってややこしい。
「Rubyで言うと?」と考えるとRubyistにはわかりやすそうなので、独断で現在主流のPython環境管理をまとめてみる。

早見表

対象 Ruby Python
バージョン rbenv pyenv
ライブラリ gem pip
ライブラリ依存/仮想環境 bundler pipenv

バージョン管理

Rubyistには同じみ rbenv、Pythonにもpyenvがある。使い方も基本的には同じ。
rbenvにはruby-buildというサブモジュールが必要だが、pyenvでは必要無い。

ライブラリ管理

pip はPython 2.7.9/3.4以降から標準付属。

ライブラリ依存/仮想環境

Pythonはたくさんあるが、Bundlerに近いpipenvが良さそうなので比較してみる。(厳密には違うが、、)

bundler pipenv
管理ファイル Gemfile Pipfile
lockファイル Gemfile.lock Pipfile.lock
lockファイルからライブラリインストール bundle install pipenv sync
仮想環境実行 bundle exec pipenv run
仮想環境パス(デフォルト) ./vendor/bundle ~/.local/share/virtualenvs/#{プロジェクトのディレクトリ名}-#{ハッシュ値}
10
5
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
10
5