How to create a Python 3.6.0 environment by putting pyenv on Amazon Linux and Ubuntu http://qiita.com/rysk92/items/878fddbf23262628d89e
It is assumed that pyenv is included in.
pyenv install 2.7.13
pyenv global 2.7.13
pip install virtualenv
pyenv-virtualenv
git clone https://github.com/yyuu/pyenv-virtualenv.git ~/.pyenv/plugins/pyenv-virtualenv
echo 'eval "$(pyenv virtualenv-init -)"' > ~/.bash_profile
For example
―― 1. A project called hoge_batch of Python 3.6.0 that is supposed to run on AWS Batch ―― 2. A project called hoge_lambda of Python 2.7.13 that is supposed to run on AWS Lambda
Suppose you want.
The path of each project is as follows.
pyenv virtualenv 3.6.0 hoge_batch
pyenv virtualenv 2.7.13 hoge_lambda
cd /path/to/hoge_batch
pyenv local hoge_batch
cd /path/to/hoge_lambda
pyenv local hoge_lambda
If you move to the path of each project, it will switch automatically.
There is a file called .python-version in the project folder, so if you delete it, the association between the folder and the environment will disappear.
Recommended Posts