D
D
Dubolom Unicellular2020-05-02 14:04:45
Python
Dubolom Unicellular, 2020-05-02 14:04:45

Why doesn't Python 3 work for me?

Why doesn't Python 3 work for me? Just when installing the module, I saw the following text on the command line:

DEPRECATION: Python 2.7 reached the end of its life on January 1st, 2020. Please upgrade your Python as Python 2.7 is no longer maintained. pip 
21.0 will drop support for Python 2.7 in January 2021. More details about Python 2 support in pip, can be found at https://pip.pypa.io/en/latest/development/release-process/#python-2-support

And then I checked the Python version using the python --version command. Brought the following:
Python 2.7.16
How? I downloaded it yesterday from the official. site and there it was written Python 3.8.2:
5ead53691318e110405156.jpeg
And I don’t even have the python3 command: I
5ead54254bdb8559070417.jpeg
also reinstalled python 2 times I clicked the add to path checkbox
How to fix this?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
A
Anastasia Taube, 2020-05-02
@duboloms

You seem to be trying to run it the wrong way. Python is started by the python command, not python3. If it doesn't work, reinstall: maybe there are problems with environment variables.
Try first to completely remove the second python, and only then install the third one. Do not forget to click on the checkbox on the path when reinstalling (I already did it, but I’ll remind you one more time, because it’s like a guide :) ). I also urge you to remember where you install the python (better copy this path, you will need it). After installation, check the environment variables.

spoiler
Как найти эти "переменные":
1. ПКМ по папке компьютера ("Этот компьютер" или "Мой компьютер", смотря где смотришь)
2. В панельке слева открывшегося окна "Система" открываешь вкладку "Дополнительные переменные среды"
3. В появившемся окне во вкладке "Дополнительно" (по идее она и должна открыться) над кнопками "ОК", "Отмена" и "Применить" будет кнопка "Переменные среды..."
4. Двойной щелчок по переменной Path.

If there are references to the second python, then delete them (although in theory there should not be any more). If there are no references to the third version in the variables, then they will have to be added manually (To do this, you need to know where you installed the python, which I really asked you to pay attention to above).
If you installed everything correctly, then two fields in the Path will definitely have similar lines (I have version 3.6.x, but this is not very important, so don't worry, you will have 3.8.x):
C:\Users\tau\AppData \Local\Programs\Python\Python36\Scripts\
C:\Users\tau\AppData\Local\Programs\Python\Python36
\ path during installation.
As a result, you should find this folder and stop at it:
spoiler
5ead6aec4d5b9350760765.png

Copy the path above (This PC > Local Disk ....) and add it to the Path environment variable. This will be the first link.
Now add the second one:
Go from the Python38 folder to the Scripts folder and copy the path to it (or just add "Scripts\" to the previous path).
Through the python command on the command line, try to run python now. In theory it should work. :)

A
Andy_U, 2020-05-02
@Andy_U

Python 3.X installs the Python Launcher (which is py/pyw). It can still be configured to run the third python by default. Here:

D:\Temp>py
Python 3.8.2 (tags/v3.8.2:7b3ab59, Feb 25 2020, 23:03:10) [MSC v.1916 64 bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> quit()

D:\Temp>py -2
Python 2.7.15 (v2.7.15:ca079a3ea3, Apr 30 2018, 16:30:26) [MSC v.1500 64 bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> quit()

D:\Temp>

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question