Python

How to install virtualenv:

Install pip first

sudo apt-get install python3-pip

Then install virtualenv using pip3

sudo pip3 install virtualenv 

Now create a virtual environment

virtualenv venv 

you can use any name insted of venv

You can also use a Python interpreter of your choice

virtualenv -p /usr/bin/python2.7 venv

Active your virtual environment:

source venv/bin/activate

Using fish shell:

source venv/bin/activate.fish

To deactivate:

deactivate

Create virtualenv using Python3

virtualenv -p python3 myenv

Instead of using virtualenv you can use this command in Python3

python3 -m venv myenv

 

You can follow this process:

Install pip3

sudo apt-get install python3-pip

Install Virtual Environment for Python3

sudo pip3 install virtualenv

Create a project directory

mkdir ~/newproject
cd ~/newproject

Create a new virtual environment and activate it

In this environment pip by default is pip3 and python by default is python3.

virtualenv .venv
source .venv/bin/activate

Now Install Django

pip install django

and then create project and start it,

django-admin startproject my_project

cd my_project

python manage.py runserver
sudo apt-get install python3-numpy

This the process to install Python3 packages by Ubuntu terminal

    • sudo is for the permission
    • apt-get install is a medium by which you will install
    • python3- will install the package in its own version of dist-package
    • numpy is the package you want to install it.

 

Visual Studio IntelliCode API Usage Examples