Install python in Ubuntu

virtualenv: a virtual environment for linux

virtualenvwrapper: A tool based on virtualenv, through which you can easily create/activate/manage/destroy virtual environments. Without it, the above operations will be quite troublesome.

Install python3

sudo apt-get install python3

sudo apt-get install python-setuptools

Install pip

sudo apt-get install pip

Install virtualenv and virtualenvwrapper

$sudo apt-get install python-virtualenv

$sudo easy_install virtualenvwrapper

  1. Create a directory to store the virtual environment

mkdir $HOME/.virtualenvs

  1. Add the line in ~/.bashrc:

export WORKON_HOME=$HOME/.virtualenvs

source /usr/local/bin/virtualenvwrapper.sh

  1. run:

source ~/.bashrc

  1. Create a python virtual environment

mkvirtualenv [virtual environment name]

  1. Switch virtual environment

workon [virtual environment name]

  1. Exit the virtual environment

deactivate

  1. Delete virtual environment

rmvirtualenv [virtual environment name]

Note: The created environment is independent and does not interfere with each other. You can use pip to manage the package without sudo permission. If you use sudo in the virtual environment, the package installed is in the main environment

Use the -p parameter to specify the version of python in the virtual environment

$ mkvirtualenv -p python django

**One more thing to note is that by default, all packages installed system-wide are visible to virtualenv. This means that if you install simplejso in your system Python directory, it will be automatically available to all virtualenvs. This behavior can be changed. Virtualenv with the --no-site-packages option added when creating a virtualenv will not read system packages, as follows:

virtualenv nowamagic_venv --no-site-packages

Install redis

Execute the following command in Ubuntu:

$sudo apt-get install redis-server

Start the server

$redis-server

Start the client

$redis-cli

Browser cache

Ctrl+Shift+Del shortcut key to clear Google browser cache

Ctrl+Shift+R Reload the current webpage without using cached content

Recommended Posts

Install python in Ubuntu
ubuntu18.04 install python2
ubuntu18.04 install python
Install mysql-pytho in Ubuntu
Install python3.6 under Ubuntu 16.04
Install Python3 on Ubuntu 14.04
Install JDK in Ubuntu19.10
Install Python3 on Ubuntu 16.04
Install Python3.7 on Ubuntu
Install VMware Tools in Ubuntu 18.04
Ubuntu install the latest Python 3.
ubuntu18.04 compile and install python3.8
How to install python in ubuntu server environment
Install Python3 environment in a brand new Ubuntu
How to install Helm in Ubuntu
How to install mysql in Ubuntu 14.04
Install and configure Docker in Ubuntu
How to install Python 3.8 on Ubuntu 18.04
Install Python virtual environment on Ubuntu 18.04
How to install mysql in Ubuntu 14.04
Install TensorFlow (python2.7 version) on Ubuntu
Ubuntu16 upgrade Python3
Relearn ubuntu --python3
ubuntu18.04 install docker
Ubuntu install guide
Centos7 install Python2.7
ubuntu install nodejs
ubuntu 16 install asp.net
ubuntu install leanote
ubuntu install Jenkins
docker install ubuntu
ubuntu install elasticsearch
Centos install Python3
ubuntu16.0.1 install pagoda
CentOS6.8 install python2.7
ubuntu 18.04 install teamviewer
ubuntu install sendmail
ubuntu16.04 upgrade python2
Install the latest Python 3.6 version on Ubuntu
How to install third-party modules in Python
How to install cuda10.1 driver in Ubuntu
How to install ROS Noetic in Ubuntu20.04
Install Ubuntu 18.04 in the virtual machine VMware
How to install Python2 on Ubuntu20.04 ubuntu/focal64
Install jetty in Ubuntu 18.04 Server, non-apt version
Use python3 to install third on ubuntu
Ubuntu18.04 switch Python version
Install gsl package in R language on ubuntu
Install apache+PHP under Ubuntu
Ubuntu20.04 install Python3 virtual environment tutorial detailed explanation
install vscode on ubuntu18
Install node.js under Ubuntu
Nagios3 in ubuntu serve
ubuntu install zsh terminal
Install Redis on Ubuntu
03. Operators in Python entry
Install R4 on ubuntu20
Install nvtop on Ubuntu 18.04
Install postgresql-10 on Ubuntu 18.04
ubuntu configuration python, Red
Install docker on Ubuntu