[LINUX] python environment settings

If I didn't touch python for 2 months, I forgot about python.

It was quite unexpected. I've forgotten more than I expected ... I might forget this again ... So this time, make a note of how to set it.

procedure

Creating and enabling a virtual environment

Installation(For linux)
$ sudo apt install python3

Creating a virtual environment file
$ python3 -m venv virtual environment name

Enable virtual environment(For linux)
$ .The name of the virtual environment/bin/activate
The virtual environment is enabled when the following is displayed.
(Virtual environment name)path$ 

Exit the virtual environment.
()$ deactive

Package management

Install the package.
()$pip install package name

Check the installed packages.
()$ pip freeze

Save the list of installed packages.
()$ pip freeze >> requirements.txt

Install the package from the list.
()$ pip install -r requirements.txt

Uninstall the package.
()$pip uninstall package name

reference

venv: Python Virtual Environment Management ↑ This may be easier to understand.

Recommended Posts

python environment settings
Python environment construction
python windows environment
Environment construction (python)
python environment construction
Emacs settings for Python development environment
Python --Environment construction
Python environment construction
python environment construction
Competitive programming with python Local environment settings
Creating amateur python environment settings (for MAC)
[Python] Get environment variables
My python environment memo
Unification of Python environment
python windows environment construction
homebrew python environment construction
Python development environment construction
python virtual environment Pipenv
About Python development environment
virtual environment in python
Python environment with docker-compose
python2.7 development environment construction
Create a Python environment
Development environment in Python
Mac environment construction Python
Virtual environment with Python 3.6
Python environment construction @ Win7
Python environment for projects
Python environment settings (virtualenv + pip cannot be done)
[Django3] Environment construction and various settings summary [Python3]
Python + Anaconda + Pycharm environment construction
Install Python environment with Anaconda
Python
Manage python environment with virtualenv
Python environment construction (Windows10 + Emacs)
Summary of python environment settings for myself [mac] [ubuntu]
Environment
CI environment construction ~ Python edition ~
Handle environment variables in Python
Build python3 environment with ubuntu 16.04
Python environment construction For Mac
Anaconda3 python environment construction procedure
Build Python environment on Windows
My python data analytics environment
Prepare python3 environment with Docker
Build python environment with direnv
Python3 environment construction (for beginners)
Organize your Python development environment
Python environment construction and TensorFlow
Building a Python virtual environment
[ev3dev × Python] Build ev3dev development environment
Build python environment on windows
venv: Python virtual environment management
Python environment construction under Windows7 environment
[MEMO] [Development environment construction] Python
[For organizing] Python development environment
Build a Python environment offline
python standard virtual environment venv
Building a Python virtual environment
Environment construction of python2 & 3 (OSX)
Python server settings (nginx + Gunicorn)