You can use a sandbox when your computer needs to use multiple versions of Python, or use Docker;
Virtualenv is a python-brought, installed by Pip
[[email protected] public]#CD jinjie_python/[[email protected] Jinjie_python]#virtualenv test1Using Base Prefix'/usr/local'New python executableinch/root/public/jinjie_python/test1/bin/python3.5Also Creating executableinch/root/public/jinjie_python/test1/bin/pythoninstalling Setuptools, Pip, Wheel...done. [[email protected] Jinjie_python]#[[email protected] Jinjie_python]#CD test1/[[email protected] test1]#lsbin include Lib[[email protected] test1]#Source Bin/activate(test1) [[email protected] test1]#PIP3 ListAppdirs (1.4.3) Packaging (16.8) Pip (9.0.1) pyparsing (2.2. 0) Setuptools (35.0.2) Six (1.10. 0) Wheel (0.29. 0) (test1) [[email protected] test1]#
1, virtualenv test1 set up sandbox
2. CD to sandbox directory, execute source bin/activate, start sandbox environment
3, deactivate exit sandbox environment
Note:
By default, the virtual environment relies on site packages in the system environment, which means that the installed third-party package in the system is also installed in the virtual environment.
If you do not want to rely on these package, then you can add parameters
--no-site-packages
Python: Sandbox (virtualenv)