LoginSignup
1
2

More than 5 years have passed since last update.

新規 pythonプロジェクト スタート時のタスク

Posted at

pyenv, virtualenvのインストール

MacOS

$ brew install pyenv
$ brew install pyenv-virtualenv

CentOS

$ sudo su - user
$ curl -L https://raw.githubusercontent.com/yyuu/pyenv-installer/master/bin/pyenv-installer | bash

下記を~/.bash_profileに追加しろ〜とかメッセージ出るので必要に応じて

export PATH="$HOME/.pyenv/bin:$PATH"
eval "$(pyenv init -)"
eval "$(pyenv virtualenv-init -)"

環境作成

pythonインストール、virtualenv作成

$ cd path/to/repo
$ pyenv install 3.5.2 # pyenv install whence してリストから選んでも可
$ pyenv virtualenv 3.5.2 virtualenv-name # virtualenv-nameは任意
$ pyenv local virtualenv-name

依存パッケージインストール

$ cd path/to/repo
$ pip install pip-package # 個別インストール
$ pip install -r requirements.txt # 一括インストール

依存パッケージリスト作成

$ cd path/to/repo
$ pip freeze > requirements.txt
1
2
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
1
2