Python version / library management can be confusing. It seems easy for Rubyist to think "What do you say in Ruby?", So I will try to summarize the current mainstream Python environment management at my own discretion.
Target | Ruby | Python |
---|---|---|
version | rbenv | pyenv |
Library | gem | pip |
Library dependent/Virtual environment | bundler | pipenv |
Rubyist has the same rbenv
, and Python has pyenv
. The usage is basically the same.
rbenv requires a submodule called ruby-build, but pyenv does not.
pip
comes standard with Python 2.7.9 / 3.4 and later.
There are a lot of Python, but pipenv
, which is close to Bundler
, seems to be good, so let's compare it. (Strictly different, but ...)
bundler | pipenv | |
---|---|---|
Management file | Gemfile | Pipfile |
lock file | Gemfile.lock | Pipfile.lock |
Library installation from lock file | bundle install | pipenv sync |
Virtual environment execution | bundle exec | pipenv run |
Virtual environment path(Default) | ./vendor/bundle | ~/.local/share/virtualenvs/#{Project directory name}-#{Hash value} |
Recommended Posts