[PYTHON] pyenv, virtualenv Use docker to manage the environment without using

pyenv, virtualenv Use docker to manage the environment without using

If the python version and the module to be installed are different for each project, I think the general (?) Solution is to use pyenv and virtualenv to build the development environment.

I have been python for 1 month so I don't know.

But rather than using pyenv, virtualenv I thought it would be better to create a development environment with docker for each project. I've tried.

Basically, I just run python inside the container I launched for development.

The python version is cut off

Just prepare a container for each version of the image

Detach module

I manage the container county that is the development environment for each project Prepare docker-compose.yml.

And in docker-compose.yml, we define a container that runs python apps. Add the following settings to the container where python runs.

python:
  volumes:
      - ./packages:/root/.local/lib/python2.7/site-packages

My goal is pip install will be installed in~ / .local /with --user. This is so that the module installed with pip will remain even if the container is deleted. Why ~ / .local / instead of the usual site-packages Synchronizing the host with the regular site-packages is included in the image from the beginning Because pip can't be used.

If you want to use vim and jedi-vim for development in python, you can put these packages in sys.path.

Recommended Posts

pyenv, virtualenv Use docker to manage the environment without using
Modulo without using%
Bubble sort without using sort
Write FizzBuzz without using "="
Quicksort without using sort
pyenv, virtualenv Use docker to manage the environment without using
How to use jupyter notebook without polluting your environment with Docker
pyenv + pyenv-Automatically load the virtualenv environment in the virtualenv environment
How to use tensorflow under docker environment
Specify the Python executable to use with virtualenv
python development environment -use of pyenv and virtualenv-
I want to use Python in the environment of pyenv + pipenv on Windows 10
How to use Virtualenv
How to use virtualenv
How to use Pyenv
How to set up a Python environment using pyenv
Execute script using pyenv dependent module without entering pyenv environment
Use Anaconda in pyenv environment
Manage python environment with virtualenv
How to use the generator
[Note] How to use virtualenv
How to manage Python minor version (build virtual environment) on Windows (without Pyenv or WSL)
How to deal with the terminal getting into the pipenv environment without permission when using pipenv with vscode
How to use the decorator
[Python] How to use virtualenv
When you want to use multiple versions of the same Python library (virtual environment using venv)
How to use Serverless Framework & Python environment variables and manage stages
How to build a Python environment using Virtualenv on Ubuntu 18.04 LTS
Learn how to use Docker through building a Django + MySQL environment
How to use the zip function
How to use the optparse module
Build a go environment using Docker
How to use virtualenv with PowerShell
How to use the ConfigParser module
Use pydoc with Virtualenv / pyenv / venv
Use Docker Desktop for Windows to start the latest odo with 2 commands
After buying a new Mac, use pyenv + poetry to build a Python environment.
I tried to execute SQL from the local environment using Looker SDK
I wanted to use jupyter notebook with docker in pip environment (opticspy)
How to find out the number of CPUs without using the sar command
[Mac] Build a Python 3.x environment at the fastest speed using Docker
How to use the Spark ML pipeline
Use tensorflow in an environment without root
Use smbus with python3 under pyenv environment
Behind the flyer: Using Docker with Python
How to create an NVIDIA Docker environment
pyenv-Building a pypy environment using virtualenv (MacOSX)
[Linux] How to use the echo command
Use of virtualenv, Python's independent execution environment
How to use the Linux grep command
Use numpy's .flatten () [0] to retrieve the value
About the development environment you are using
How to use the IPython debugger (ipdb)
Introduction to docker Create ubuntu environment in ubuntu
3 best ways to use the less command
Use WebDAV in a Portable Docker environment
How to pass the path to the library built with pyenv and virtualenv in PyCharm
Environment construction procedure to operate chrome without installing python on Windows (using selenium)
Flutter in Docker-How to build and use a Flutter development environment inside a Docker container
Why Docker is so popular. What is Docker in the first place? How to use
A complete guidebook to using pyenv, pip and python in an offline environment
I want to use mkl with numpy and scipy under pyenv + poetry environment