Python version: 3.6

Step 1: Pack:

#!/usr/bin/env bash

python3.6 -m venv venv
source ./venv/bin/activate
echo 'PATH="/{some-path}/venv/bin:${PATH}"' >> ./venv/bin/activate
pip install -r requirements.txt
Copy the code

The only thing to note is that {some-path} should be the same as the venv folder you deployed in,

That is, if we copy the venv environment to the /data/app directory of the machine in the future to activate, then our
{some-path}To write/data/app

The second step:

Copy to {some-path} directory on your machine

Only the Python3.6 interpreter needs to be installed on the machine

Step 3:

source /{some-path}/venv/bin/activate
Copy the code

The end user will be preceded by a (VENv) flag, as shown:


Note that you are in a virtual environment and that packages in requirements.txt are available directly.

To exit, run: deactive.

Please indicate the source of reprint: Book, for attention, for praise oh