Register to get access to free programming courses with interactive exercises

Installing Python Python: Setting up the environment

We'll start this course by setting up Python. It can be downloaded and installed from the official Python website, but it is better to do this using a package manager.

To begin, open a terminal and run the command appropriate for your operating system:

  • The command for Ubuntu or Ubuntu on Windows (WSL) is:

    sudo apt update
    sudo apt install python3
    
  • Command for MacOS is:

    # https://brew.sh/index_ru.html
    brew install python
    

Now is a time to make sure Python is installed and properly working. To do this, type python3 --version in a terminal. The output should look like this:

asciicast

Make sure you have at least 3.8 installed.

To learn successfully, you need to practice. Type out all the code from the tutorial and run it locally. It is the only way to understand what is going on.

In cases where an interactive interpreter isn't enough, we should run code as files. To do this, create a file with any name and a .py extension, and then run it:

asciicast

We should run the code from the same directory as the main.py file. If you don't start from the same directory, you need to specify the path to the file.

The pyenv utility

A completely different way to install Python is to use the pyenv utility (for Windows users, you will need a specific version of the utility — pyenv-win).

In addition to installing any version of Python, this utility allows you to switch between versions easily. It may be convenient if you're working on several projects that require you to use different versions of Python at the same time.


Recommended materials

  1. Installing Ubuntu on Windows
  2. Installing GIT on Windows

Are there any more questions? Ask them in the Discussion section.

The Hexlet support team or other students will answer you.

About Hexlet learning process

For full access to the course you need a professional subscription.

A professional subscription will give you full access to all Hexlet courses, projects and lifetime access to the theory of lessons learned. You can cancel your subscription at any time.

Get access
130
courses
1000
exercises
2000+
hours of theory
3200
tests

Sign up

Programming courses for beginners and experienced developers. Start training for free

  • 130 courses, 2000+ hours of theory
  • 1000 practical tasks in a browser
  • 360 000 students
By sending this form, you agree to our Personal Policy and Service Conditions

Our graduates work in companies:

<span class="translation_missing" title="translation missing: en.web.courses.lessons.registration.bookmate">Bookmate</span>
<span class="translation_missing" title="translation missing: en.web.courses.lessons.registration.healthsamurai">Healthsamurai</span>
<span class="translation_missing" title="translation missing: en.web.courses.lessons.registration.dualboot">Dualboot</span>
<span class="translation_missing" title="translation missing: en.web.courses.lessons.registration.abbyy">Abbyy</span>
Suggested learning programs
profession
new
Developing web applications with Django
10 months
from scratch
under development
Start at any time

Use Hexlet to the fullest extent!

  • Ask questions about the lesson
  • Test your knowledge in quizzes
  • Practice in your browser
  • Track your progress

Sign up or sign in

By sending this form, you agree to our Personal Policy and Service Conditions
Toto Image

Ask questions if you want to discuss a theory or an exercise. Hexlet Support Team and experienced community members can help find answers and solve a problem.