Visual Studio Code is a code editor redefined and optimized for building and debugging modern web and cloud applications. Visual Studio Code is free and available on your favorite platform. 47 Visual Studio Code enabled official Linux repositories on February 2017 (v1.10) sudo add-apt-repository -y 'deb stable main ' sudo apt update sudo apt -y install code You can upgrade / dist-upgrade as usual. Browse other questions tagged apt software-installation snap 19.04 visual-studio-code or ask your own question. The Overflow Blog Podcast 328: For Twilio’s CIO, every internal developer is a customer.
- Installing Visual Studio Code. Installing via apt. The repository and key can also be installed manually with the following script: curl https://packages.microsoft.
- Download and Install Visual Studio Code with gdebi. The easiest and best method is to download the vscode.deb package and install it using the gdebi command. So first of all make sure you have install gdebi-core package on your Ubuntu Desktop. Sudo apt-get update sudo apt-get install gdebi-core. Next, we need to download vs code for Ubuntu, Go.
The commands on the following page has been performed and tested with thefollowing versions:
- Ubuntu 18.04 LTS 64bits
- Linux 4.15.0-76-generic
- Python 3.6.9
- Visual Studio Code 1.42.1
Update your system
Start by updating your system:
Install Visual Studio Code
Install Visual Studio Code with Ubuntu Software. Other methods can be used,but Ubuntu Software remains the more stable option.
Install Python
Python is already installed on Ubuntu. But be carrefull, two versions coexiston ubuntu: Python 2.7.17 and Python 3.6.9. The default version is the older one.I advise against using this old version. Instead, I strongly recommandusing virtual environments with Python 3.
Install the Python paquet manager pip:
or
Virtual environment
Install virtualenv with the following command:
Create a virtual environment for your project and specify this environment willuse Python 3.
You'll have to run the previous command everytime you'll create a new Python project.Activate your environment:
The name of the environment should appear at the beginning of your command line:
Validate that everything is fine by checking the versions:
You can deactivate the virtual environment with the following command:
Configure Visual Studio Code for Python
Launch Visual Studio Code. In File
>Open folder
[Ctrl-K Ctrl-O], sélect thefolder where you created your virtual environment. Create a Python script namedversion.py
and add the following code:
Run your script by hitting CTRL-F5
. Visual Studio Code should ask you if you want to installpylint
for checking code quality and suggest best practices. I strongly recommand to accept andinstall pylint
.
You script should display something like:
Python 3 is running in your virtual environment in Visual Studio Code. You caneven set break points and debug your application by hitting F5
instead of Ctrl-F5
.
Enjoy!