How to prepare an environment with different python version and package for each project with pyenv-virtualenv on Amazon Linux

Premise

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.

Install virtualenv

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

Create an environment

Premise

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.

Creating an environment

pyenv virtualenv 3.6.0 hoge_batch
pyenv virtualenv 2.7.13 hoge_lambda

Environment settings

cd /path/to/hoge_batch
pyenv local hoge_batch

cd /path/to/hoge_lambda
pyenv local hoge_lambda

Switching environment

If you move to the path of each project, it will switch automatically.

Canceling environment settings

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

How to prepare an environment with different python version and package for each project with pyenv-virtualenv on Amazon Linux
How to build a Python environment on amazon linux 2
How to create a Python 3.6.0 environment by putting pyenv on Amazon Linux and Ubuntu
How to set the development environment for each project with VSCode + Python extension + Miniconda
How to build an environment for using multiple versions of Python on Mac
Build a python environment for each directory with pyenv-virtualenv
Create an environment for MkDocs on Amazon Linux (attempted)
Compile and install MySQL-python for python2.7 on amazon linux
How to pass args or environment variables with Makefile and make command on #Linux
A memo on how to easily prepare a Linux exercise environment
How to set up WSL2 on Windows 10 and create a study environment for Linux commands
How to install nkf with rpm file on Red Hat Enterprise Linux 7.7 (for non-internet environment)
[Sakura Rental Server] (For beginners) How to build an environment for Python, pyenv, and Flask. | For csh
Prepare pipenv environment with amazon Linux 2
Introduce Python 3.5.2 environment on Amazon Linux
I tried to create an environment of MkDocs on Amazon Linux
Switch the package to be installed for each environment with poetry
How to use an external editor for Python development with Grasshopper
Prepare an environment to use OpenCV and Pillow with AWS Lambda
How to automatically install Chrome Driver for Chrome version with Python + Selenium + Chrome
How to build Python and Jupyter execution environment with VS Code
Anyone can understand how to build an initial environment for Python on Mac September 2016 (pyenv + virutalenv)
Prepare a Python virtual environment for your project with venv with VS Code
How to package and distribute Python scripts
Prepare Python development environment for each project in Windows environment (VSCode + virtualEnvWrapper + Pylint)
Building a Python3 environment with Amazon Linux2
Procedure for building a kube environment on amazon linux2 (aws) ~ (with bonus)
Data integration from Python app on Linux to Amazon Redshift with ODBC
How to update php on Amazon linux 2
How to prepare Python development environment [Mac]
Build an LNPP environment on Amazon Linux 2
Prepare an environment to touch grib2 format files with python (Docker edition)
How to install Anisble on Amazon Linux 2
Put MeCab binding for Python with pip on Windows, mac and Linux
Useful for changing permissions on Linux! How to count up to 31 with one hand.
How to get started with the 2020 Python project (windows wsl and mac standardization)
Notes from installing Homebrew to building an Anaconda environment for Python with pyenv
How to use Service Account OAuth and API with Google API Client for python
[Python] How to create a local web server environment with SimpleHTTPServer and CGIHTTPServer
[2020 version] How to install Python3 on AWS EC2
Strategy on how to monetize with Python Java
Building an Anaconda environment for Python with pyenv
How to crop an image with Python + OpenCV
How to build Java environment on Ubuntu (Linux)
A story about how Windows 10 users created an environment to use OpenCV3 with Python 3.5
[AWS EC2] How to install only MySQL client on Amazon Linux 2 and connect to RDS
I tried to build an environment for machine learning with Python (Mac OS X)
Yum command to access MySQL with Python 3 on Linux
[Linux] WSL2 Build an environment for laravel7 with Ubuntu 20.04
How to build a Django (python) environment on docker
Building an environment for natural language processing with Python
[AWS EC2] How to install Maven on Amazon Linux 2
Python # How to check type and type for super beginners
[AWS] How to expand disk space on Amazon linux
[Linux] How to install a package on a server that does not have a network environment (standalone)
I created an environment for Masonite, a Python web framework similar to Laravel, with Docker!
How to manage Python minor version (build virtual environment) on Windows (without Pyenv or WSL)
On a Linux environment, create a NuGet package from a C # project and load it into another project
How to find the cumulative sum / sum for each group using DataFrame in Spark [Python version]
Rebuilding an environment for machine learning with Miniconda (Windows version)
Build an environment for machine learning using Python on MacOSX